设置按钮边框颜色:
在drawable中 新建一个button_edge.xml文件
使用:
android:background="@drawable/button_edge"
圆角按钮:(其实按钮还是方形的,只是将外围部分隐藏了而已)
在drawable中: 新建一个 button_circle_shape.xml文件
android:topLeftRadius="10dp"
android:topRightRadius="10dp"
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
/>
**设置文字padding**
使用:
android:background="@drawable/shape"
设置圆角图片
简单的设置:(不能添加自定义图片 只能设置颜色和字体)
在drawable中 创建一个image_circle.xml图片
使用:
android:background="@drawable/image_circle"
可以给自定义图片加圆角
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标移动开发之Android频道