• 这个属性可以在LinearLayout的每个子布局直间添加一个“drawable”作为分割线,这个drawable必须有设定好的高度或者宽度,因此不能直接设置为“@color/….”
  • 这个属性要和android:showDividers一起使用才会生效
  • android:showDividers有“begining”,“middle”,“end”,“none”四种值。默认值为“none”,即不显示分割线。

    你还在为开发中频繁切换环境打包而烦恼吗?快来试试 Environment Switcher 吧!使用它可以在app运行时一键切换环境,而且还支持其他贴心小功能,有了它妈妈再也不用担心频繁环境切换了。https://github.com/CodeXiaoMai/EnvironmentSwitcher


android:showDividers=”beginning”

<LinearLayout    android:id="@+id/container"    android:layout_width="match_parent"    android:layout_height="wrap_content"    android:showDividers="beginning"    android:orientation="vertical"    android:divider="@drawable/list_divider"    android:padding="@dimen/margin_normal">    <Button        android:text="sdf"        android:layout_width="wrap_content"        android:layout_height="wrap_content" />    <Button        android:text="sdf"        android:layout_width="wrap_content"        android:layout_height="wrap_content" />    <Button        android:text="sdf"        android:layout_width="wrap_content"        android:layout_height="wrap_content" />LinearLayout>

只有第一个子控件上面有一条分割线
Linearlayout的android:divider属性_第1张图片

android:showDividers=”middle”

每个子空间之间都有一条分割线
Linearlayout的android:divider属性_第2张图片

android:showDividers=”end”

只有最后一个子控件有一条分割线
Linearlayout的android:divider属性_第3张图片

更多相关文章

  1. 如何设置Android命令行环境变量
  2. SDK3.0 组件属性
  3. ubuntu搭建Android NDK环境与Android Studio简单使用NDK
  4. android学习笔记(1)---搭建开发环境
  5. [置顶] Android中_TextView属性的XML详解 包括单行显示等等。

随机推荐

  1. android如何获取默认的桌面程序
  2. (转载)Android一些不常见的API及一些其他
  3. android 自定义标题栏 titleBar自定义
  4. android动画及用法
  5. Android_framework层Service解析
  6. Android弹出拨号界面和拨打电话实现
  7. [Android(安卓)Studio] FloatingActionBu
  8. Android中如何避免ANR
  9. Android上的Ubuntu Debian Armel
  10. Android程序中输入法弹出的时候如何不遮