Android笔记:实现圆角的Button
16lz
2021-01-26
在drawable里,选择shape
<?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <!-- 填充的颜色 --> <solid android:color="#FFFFFF" /> <!-- 设置按钮的四个角为弧形 --> <!-- android:radius 弧形的半径 --> <corners android:radius="5dip" /> <!-- padding:Button里面的文字与Button边界的间隔 --> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" /> </shape>
在Button里
<Button android:id="@+id/crime_date" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="10dp" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:layout_marginTop="10dp" android:background="@drawable/shape"/>
更多相关文章
- android-圆角button
- drawable之使用shape:制作圆角背景
- android 多个自定义dialog
- View编程(2): invalidate()再探
- Android使用shape设置虚线、圆角、渐变
- android shape的使用 自定义 控件形状
- android shape的使用 2
- Android(安卓)Material Design动画 Reveal Effect | 揭示效果
- android 使用xml drawable 实现 局部圆角,可用作圆角边框