Linearlayout的android:divider属性
16lz
2021-12-04
- 这个属性可以在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>
只有第一个子控件上面有一条分割线
android:showDividers=”middle”
每个子空间之间都有一条分割线
android:showDividers=”end”
只有最后一个子控件有一条分割线
更多相关文章
- 【阿里云镜像】切换阿里巴巴开源镜像站镜像——Fedora镜像
- 【阿里云镜像】切换阿里巴巴开源镜像站镜像——Debian镜像
- 如何设置Android命令行环境变量
- ubuntu搭建Android(安卓)NDK环境与Android(安卓)Studio简单使用N
- Android(安卓)SDK 2.2 开发环境搭建
- Android(安卓)SDK 2.2 开发环境搭建
- Android禁止横屏竖屏切换
- Android禁止横屏竖屏切换
- Android横竖屏切换方法