Android Studio Button 美化
16lz
2021-01-23
改变按钮Button控件的边角、填充颜色、边框颜色。
步骤:
- 在 res>drawable 中新建一个 btn_all_shape.xml :
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" android:topLeftRadius="15dp" android:topRightRadius="15dp" /> <!-- 设置填充颜色 --> <solid android:color="@color/green" /> <!-- 设置边框颜色 --> <stroke android:width="2dp" android:color="@color/white"/></shape>
- 在要改变的按键的xml中添加这一句:
android:background="@drawable/btn_all_shape"
更多相关文章
- 修改android statusbar颜色
- Android中字体颜色的设置
- Android知识点记录: 使用代码设置 android 上listView的条目的点
- android 字符串、颜色和尺寸
- Android实现边框圆角
- Android materialDesign 风格阴影 改变阴影颜色
- (Android)react-native更改状态栏文字和图标颜色
- Android TextView中文字通过SpannableString来设置超链接、颜色
- 《Android/OPhone开发完全讲义》连载(6):为TextView组件加上边框