android 圆角布局
16lz
2021-01-23
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 内部颜色 -->
<solid android:color="#00A5C6"/>
<!-- 边缘线条颜色 -->
<stroke android:width="1.0px" android:color="#00A5C6"/>
<!-- 圆角的幅度 -->
<corners
android:topLeftRadius="10dip"
android:topRightRadius="10dip"
android:bottomLeftRadius="0dip"
android:bottomRightRadius="0dip"/>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 内部颜色 -->
<solid android:color="#00A5C6"/>
<!-- 边缘线条颜色 -->
<stroke android:width="1.0px" android:color="#00A5C6"/>
<!-- 圆角的幅度 -->
<corners
android:topLeftRadius="10dip"
android:topRightRadius="10dip"
android:bottomLeftRadius="0dip"
android:bottomRightRadius="0dip"/>
</shape>
使用时直接设置background就额可以了:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="50dip"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:layout_marginTop="20dip"
android:focusable="true"
android:clickable="true"
android:background="@xml/test_selector" >
</LinearLayout>
更多相关文章
- Android Studio Gradle多渠道打包(动态设定App名称,应用图标,背景
- 设置listview中的item的颜色
- Android开发 - 丰富常用的颜色文件colors.xml
- android 颜色 获取
- Android:改变 Toolbar 的文字和溢出图标颜色
- android > 设置button 背景颜色
- android颜色设使用方法