我是靠谱客的博主 昏睡画板,这篇文章主要介绍LinearLayout设置白色背景、灰色边框、倒圆角,现在分享给大家,希望可以做个参考。

 1.首先在res-->drawable目录下新建一个xml文件,类型选择drawable,命名layout_border.xml,在其中写入以下代码:


<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#FFFFFF" />
<stroke
android:width="0.01dp"
android:color="#BFBFBF" />
<!-- 这个可以不加,padding用不上
<padding
android:bottom="1dp"
android:left="0.5dp"
android:right="0.5dp"
android:top="0dp" /> -->
<!-- 圆角
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp" /> -->
</shape>


2.在要设置边框的控件xml命令里加入:android: background=“@ drawable /layout_border

最后

以上就是昏睡画板最近收集整理的关于LinearLayout设置白色背景、灰色边框、倒圆角的全部内容,更多相关LinearLayout设置白色背景、灰色边框、倒圆角内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(129)

评论列表共有 0 条评论

立即
投稿
返回
顶部