-
【Android】android中面试官常问的如何加分割线
2016-10-22 10:22:50我在面试的时候被问到怎么在项目中加分割线(ListView,GridView,RecyclerView这样自带分割线的组件不算),其实方法很简单,用一个TextView就足够了,水平的分割线就把高度设为1dp,长度设为match_parent;...我在面试的时候被问到怎么在项目中加分割线(ListView,GridView,RecyclerView这样自带分割线的组件不算),其实方法很简单,用一个TextView就足够了,水平的分割线就把高度设为1dp,长度设为match_parent;若是垂直的分割线就把长度设为1dp,宽度设为match_parent就OK了,下面请看布局文件代码:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.ifreshwing.speedshooting.LoginActivity"> <include android:id="@+id/toolbar" layout="@layout/toolbar" /> <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="8dp" android:text="功能设置(未开放)" /> <span style="color:#ff0000;"><TextView android:layout_width="match_parent" android:layout_height="1px" android:background="@color/colorGray" /></span> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorWhite" android:orientation="vertical"> <LinearLayout android:id="@+id/pic_quality" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="图片质量" android:textColor="@android:color/black" /> <TextView android:id="@+id/pic_q" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:paddingRight="8dp" android:text="一般" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/table_view_arrow" /> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="1px" android:layout_marginLeft="8dp" android:background="@color/colorGray" /> <LinearLayout android:id="@+id/suitettle_lay" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="使用场合" android:textColor="@android:color/black" /> <TextView android:id="@+id/suitettle_bt" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:paddingRight="8dp" android:text="淘宝" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/table_view_arrow" /> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="1px" android:layout_marginLeft="8dp" android:background="@color/colorGray" /> <LinearLayout android:id="@+id/client" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="客户端" android:textColor="@android:color/black" /> <TextView android:id="@+id/client_tv" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:paddingRight="8dp" android:text="手机" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/table_view_arrow" /> </LinearLayout> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="1px" android:background="@color/colorGray" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:padding="8dp" android:text="保存设置" /> <TextView android:layout_width="match_parent" android:layout_height="1px" android:background="@color/colorGray" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorWhite" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="自动分解保存" android:textColor="@android:color/black" /> <Switch android:id="@+id/mswitch" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="1px" android:layout_marginLeft="8dp" android:background="@color/colorGray" /> <LinearLayout android:id="@+id/save_way" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="保存方式" android:textColor="@android:color/black" /> <TextView android:id="@+id/save_tv" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:paddingRight="8dp" android:text="自动生成" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/table_view_arrow" /> </LinearLayout> <!--<TextView android:layout_width="match_parent" android:layout_height="1px" android:layout_marginLeft="8dp" android:background="@color/colorGray" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="客户端" android:textColor="@android:color/black" /> <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="right" android:paddingRight="8dp" android:text="手机" /> <ImageView android:layout_width="wrap_content" android:src="@mipmap/table_view_arrow" /> </LinearLayout>--> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="1px" android:background="@color/colorGray" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:padding="8dp" android:text="其他" /> <TextView android:layout_width="match_parent" android:layout_height="1px" android:background="@color/colorGray" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorWhite" android:orientation="vertical"> <LinearLayout android:id="@+id/suggestions" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="意见反馈" android:textColor="@android:color/black" /> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="1px" android:layout_marginLeft="8dp" android:background="@color/colorGray" /> <LinearLayout android:id="@+id/team" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="开发团队" android:textColor="@android:color/black" /> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="1px" android:layout_marginLeft="8dp" android:background="@color/colorGray" /> <LinearLayout android:id="@+id/quite_ll" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="退出登录" android:textColor="@android:color/black" /> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="1px" android:layout_marginLeft="8dp" android:background="@color/colorGray" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:padding="8dp"> <TextView android:id="@+id/app_version" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="淘立拍1.3" android:textColor="@android:color/black" /> </LinearLayout> </LinearLayout> <TextView android:layout_width="match_parent" android:layout_height="1px" android:background="@color/colorGray" /> </LinearLayout> </ScrollView> </LinearLayout>
上面红色的部分就是分割线了,颜色是灰色#aaa(垂直分割线就不贴代码了),效果图如下: -
如何在多个LunearLayout中添加分割线
2016-10-13 11:54:44如果适用所有Android版本,可以在多个LinearLayout放置用于显示分割线的View。 在Android3.0及以上版本,LinearLayout支持直接...如果有多个LinearLayout,显示效果就和在LinearLayout之间加分割线是一样的。如果适用所有Android版本,可以在多个LinearLayout放置用于显示分割线的View。
在Android3.0及以上版本,LinearLayout支持直接显示分割线。设置<LinearLayout>标签的android:showDividers属性可以在LinearLayout的相应位置显示分割线。如果有多个LinearLayout,显示效果就和在LinearLayout之间加分割线是一样的。
android:showDividers属性可以设置如下4个值。
none:不显示分割线。
beginning:在LinearLayout的开始处(顶边)显示分割线。
end:在LinearLayout的结尾处(底边)显示分割线。
middle:在LinearLayout中的每2个组件间显示分割线。
除了需要设置android:showDeviders属性外,还需要设置android:divider属性,该属性表示分隔线的图像,需要一个DrawableID。
在Java代码中可以使用下面2个方法设置android:showDividers和android:divider。
linearLayout.setShowDividers
linearLayout.setDividerDrawable
-
listview 如何去除ListView中Header、Footer View中的分割线
2016-05-04 08:48:32以为只要设置 Android:headerDividersEnabled="false" 就可以让Header中的分割线消失,但实际并非如此啊, 设置后如图中第二张图; 分割线确实消失了,但是位置还是留着.. 这可不行啊,不能满足我的需求。 ...以为只要设置 Android:headerDividersEnabled="false" 就可以让Header中的分割线消失,但实际并非如此啊, 设置后如图中第二张图; 分割线确实消失了,但是位置还是留着.. 这可不行啊,不能满足我的需求。
最后设置了 android:divider="@null", 然后为ListView的 Item 视图加了跟线, 算是基本满足需求,不知道有没有更好的方法, 如果有的话还希望大家可以告诉我。
android:divider="@null"
我也用过,很好用。
遇到同样问题
解决方法如下
listview 设置:
android:headerDividersEnabled=“false”
android:layout_marginTop="-2dip"
listview的layout_marginTop高度设置为负数,大小为分隔符的高度 -
idea设置方法分割线图解
2021-02-14 20:01:44如题 如何将java代码用分割线分割,让java类方法结构更加清晰 步骤1 工欲善其事必先利其器 感谢点赞,让我们一起进步 主java后端开发 正在学习springcloud 可以加v 17633812442 一起交流如题 如何将java代码用分割线分割,让java类方法结构更加清晰
步骤1
工欲善其事必先利其器
感谢点赞,让我们一起进步
主java后端开发 正在学习springcloud 可以加v 17633812442 一起交流 -
记录一下 android ListView代码设置分割线
2017-04-28 14:23:48有些时候,因为公司的需求,可能还在android上面涉及一些类似的表格的格式,这里记录下载代码中如何设置ListView的分割线以及颜色 mList.setDivider(new ColorDrawable(0xffB4B3B3));//设置分割线颜色 mList.... -
RecyclerView之利用ItemDecoration实现万能分割线
2018-06-28 18:58:20上一篇文章讲了如何使用ItemDecoration去实现RecyclerView的万能间距,可是很多时候我们的需求里还会有分割线,有时候既要有合适的间距,也要有分割线,这种需求多出现在列表中,也就是网格布局中,这个时候就需要... -
T14 HTML input range 的style样式设置:分割线和长度
2020-07-08 13:19:30range是HTML语言中input类的重要且方便的类型。 想要改变range的长度,并且加分割条 tick, 如何设置? -
java加密 密文中含有+号_全同态加密是如何被解决的-5
2020-12-23 19:34:29前言:这篇文章是由陈智罡博士于2013年写的博客文章,当时全同态加密研究...———————————这是一条美丽的分割线——————————————4、 电路复杂度前面的方案中大家看到了是按“位”来加密的(即m... -
class文件如何在linux下打开_Linux-Ubuntu下VIM对文本文件加密及解密
2020-12-10 21:33:14立题简介:内容:windows下安装Virtual Box虚拟机;来源:实际得出;作用:windows下安装Virtual Box虚拟机;...=====================分割线========================立题详解:本次介绍“Linu... -
如何利用markdown
2020-05-14 23:14:08分割线 三个杠—回车 图片 一个英文!号加[ 图片名称 ]加( 图片路径 ) 超链接 一个[ 超链接名 ]加( 超链接地址 ) 点击跳转到超链接 列表 一加一个点.再按空格 回车自动生产二级列表 如果把第2列删了会自动把第3列... -
如何编辑使用Markdown?
2020-06-14 14:51:59Markdown学习(一级标题) 一级标题:#+空格 二级标题 二级标题:两个##+空格,以此类推 三级标题 四级标题 字体 Hello,Tepora!...分割线:三个-或者三个* 图片 [外链图片转存失败,源站可能有防盗链机制, -
我的第一篇博客——如何写Markdown
2021-02-11 22:19:30我的第一博客——如何写Markdown ...分割线的创建方式:- - -+回车 / ~ ~ ~+回车 4.引用 引用的创建方式: > 热爱可抵岁月漫长 5.列表 有序列表: 快捷键: ctrl+shift+[ / 1.空格+回车 无序 -
如何用Typora编辑简单的文档?
2018-11-14 00:08:38分割线如何编辑文字?1.加粗2.斜体3. 斜体加粗4.删除线5.引用6.脚注7.特殊符号如何添加元素?1.图片2.网址3.链接4.表格5.代码5.1 单行代码5.2 多行代码 如何组织文档? 1.标题 语法: # 一级标题 ## 二级标题... -
如何使用typora编辑器
2020-06-05 22:25:55如何使用markdown ...下载你电脑对应的markerdown,下载完之后你可以通过创建文本文档修改后缀名为md(前提是安装了markdown) ...4.分割线 三个- 5图片: 这个后你可以自己选择是本地的还是从网页上的图 -
如何提高UI设计中画面层次感
2020-09-24 15:05:53很多设计师容易犯一个错:设计不明确。设计一旦不明确,就容易让用户产生疑惑,甚至认为出现了bug!我的原则就是,要么不做变化,要做咱就做的彻底一点,明确一点!... 我们有一次在加分割块的时候就出现了一个.. -
P1429-平面最近点对(加强版)【分治】
2020-08-01 18:29:57在分割线左边 在分割线右边 穿过分割线 我们知道1和2可以用分治到两边计算,考虑如何求情况3。暴力枚举对数肯定会TLETLETLE,考虑优化,假设我们已经知道1和2的最小解d1,d2d1,d2d1,d2了,我们有d=min{d1,d2}d=min\{... -
VC工具栏中插入分隔线最简单的方法
2012-07-09 11:32:54退而求其次,找到了这个在一条工具栏的按钮间加分割线的简单方法,就分割开来当多条工具条用吧。 用记事本打开.rc资源文件,定位到TOOLBAR定义的地方,如下所示: IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15 ... -
基于纹理脊线特征融合的木材表面裂缝检测.pdf
2019-09-20 10:53:02基于纹理脊线特征融合的木材表面裂缝检测.pdf,裂缝是木材表面一种严重缺陷,对木材的加工和使用影响极大,然而,由于裂缝与木材表面的矿物线具有诸多相似之处,因此如何准确地将裂缝纹理识别出来是一个亟待解决的... -
高等数学学习笔记——第八十三讲——对弧长的曲线积分的概念与计算
2020-05-17 12:43:52一、问题的引入——如何计算圆周和维维安尼曲线之间的柱面片的面积? 二、对弧长曲线积分的概念 1. 空间曲线型构件的质量(分割取近似、作和求极限) 2. 对弧长的曲线积分的定义(第一型曲线积分、被积... -
如何画圆柱_产品手绘中的圆柱体如何Sketch?
2021-01-13 17:36:03圆柱体便是其中常用经典百变的一个形态,可以通过不同的设计手法(如:极简、加减、曲线切割、片状处理、切削、包裹、分割、添加纹理、镂空等)可以将圆柱体设计出很多花样,在通过外观造型与功能的结合让造型的出现... -
如何优雅地使用typora语法
2020-12-11 09:11:07***分割线 , --- 2 分级标题 # 一级标题 ## 二级标题 ### 三级标题 ... 3 超链接 3.1 文本链接 [百度搜索](www.baidu.com) [友邻学社](www.yiyouls.com) 3.2 地址链接 <http://www.yiyouls.com> 4 锚点 ##... -
50欧姆线设计 高频pcb_实用!高频PCB电路设计10问
2020-12-14 17:41:4201如何处理实际布线中的一些理论冲突的问题?基本上,将模/数地分割隔离是对的。要注意的是信号走线尽量不要跨过有分割的地方(moat),还有不要让电源和信号的回流电流路径(returning current path)变太大。晶振是... -
50欧姆线设计 高频pcb_高频PCB电路设计10问,请收藏
2021-01-01 14:51:451、如何处理实际布线中的一些理论冲突的问题?基本上,将模/数地分割隔离是对的。要注意的是信号走线尽量不要跨过有分割的地方(moat),还有不要让电源和信号的回流电流路径(returning current path)变太大。晶振是... -
当你微信加了领导好友后,一切都变了……
2015-08-23 20:16:51有一类微信好友叫领导,他们的加入几乎能成为一个人微信风格改变的前后分割线。有了领导好友的微信,稍有使用不当,后果很严重。领导加了微信后,员工就没法淡定了。领导求加好友,你无法拒绝按理说,微信加谁为好友... -
如何快速学会写markdown文章
2020-12-21 11:48:10快速学会使用markdown 第一次使用 Markdown编辑器 编写文章的小伙伴可以仔细阅读这篇文章,了解一下Markdown的...4、分割线 连打三个星号*** 5、链接 这是一个链接 百度一下 6、代码块 插入代码 .css{ width:200px; -
论文研究-标准模型下的高效强安全混合加密方案.pdf
2019-09-11 06:12:27如何设计标准模型下满足适应性选择密文安全(IND-CCA2)的高效加密方案,是公钥密码学领域的一个重要研究课题。基于判定型双线性Diffie-Hellman问题,提出了一个高效、短公/私钥长度、强安全的,基于对称加密算法、... -
PCB如何进行拼版?详细步骤分解
2020-07-14 12:05:34因此,设计和制造之间的联系是极其紧密的,到了不可分割的地步。 电子产品从设计完成到加工制造其中最重要的一个环节就是PCB电路板的加工。而PCB加工出来的裸板绝大部分情况是要过贴片机贴片装配的。 那么问题来了... -
三维学习软件篇之如何提高计算效率
2020-11-18 16:44:43那天某个同学在三维学习群里面问了一个问题:怎么用AutoCAD直接画出一段长度为 24/7,角度为 ...AutoCAD 的计算器分割线 其实做为一款辅助设计的软件,AutoCAD 本身就具有强大的计算能力,并且这种计算能力是开放给用户 -
如何写博客?用编辑语言MarkDown,这里有MarkDown的基础知识,常用语法
2019-01-28 16:06:55MarkDownPad基础知识 1.快捷键 * 加粗 Ctrl + B (bold) * 斜体 Ctrl + I (italics) * 引用 Ctrl + Q (quote) * 插入连接 Ctrl + L (link) * 插入代码 Ctrl + K ...* 横线(分割线) Ctrl + R ... -
HQChart使用教程39-指标中如何绘制文本分割线 HQChart使用教程40-如何自定义分钟周期或日线周期K线 HQChart使用教程41-分钟K线设置拖拽自动下载历史数据 HQChart使用教程42-K线图如何对接数字货币 ...
-
页面切换的动画过渡
-
LVS + Keepalived 实现 MySQL 负载均衡与高可用
-
跨标签抑制:具有组正则化的判别性和快速词典学习
-
重磅!巴菲特2021年致股东公开信(中译版,下篇)
-
工程制图 AutoCAD 2012 从二维到三维
-
MySQL 主从复制 Replication 详解(Linux 和 W
-
Python:让繁琐工作自动化
-
linux基础入门和项目实战部署系列课程
-
具有输入饱和度的分数阶系统的自适应反步状态反馈控制
-
LeetCode 110. 平衡二叉树
-
金融安全应用规范.zip
-
一天学完MySQL数据库
-
自动化测试Python3+Selenium3+Unittest
-
C#编码规范
-
通过学习词典和彩色视觉特性来评估无参考立体图像质量
-
深究字符编码的奥秘,与乱码说再见
-
项目管理工具与方法
-
图像读取速度对比
-
PTA团体程序设计天梯赛-L2-006 树的遍历
-
FruitEat-master.zip