android带边框的shape,Android开发之Shape的使用(为TextView等空间添加边框)
在Android开发中,我们想为控件添加边框,可以使用Shape。首先,我先简单介绍一下Shape。solid:填充gradient:渐变stroke:描边corners:圆角padding:间隔Shape的使用如下,制作椭圆形边框textview_bg.xml。android:width="1dp"android:color="#000000" /> android:bottomLeftR
·
在Android开发中,我们想为控件添加边框,可以使用Shape。
首先,我先简单介绍一下Shape。
solid:填充
gradient:渐变
stroke:描边
corners:圆角
padding:间隔
Shape的使用如下,制作椭圆形边框textview_bg.xml。
android:width="1dp"
android:color="#000000" />
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
android:bottom="4dp"
android:left="4dp"
android:right="4dp"
android:top="4dp" />
为TextView添加Shape制作好的椭圆形边框。
android:background="@drawable/textview_bg"
更多推荐
已为社区贡献2条内容
所有评论(0)