前端之家收集整理的这篇文章主要介绍了
xml中设置圆角矩形,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
- <?xml version="1.0" encoding="utf-8"?>
- <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
- <item>
- <shape android:shape="rectangle">
- <solid android:color="#02D485" />
- <corners
- android:topLeftRadius="5dip"
- android:topRightRadius="5dip"
- android:bottomLeftRadius="5dip"
- android:bottomRightRadius="5dip" />
- </shape>
- </item>
- <item android:top="1px" android:bottom="1px" android:left="1px" android:right="1px">
- <shape>
- <gradient
- android:startColor="#EAEAEA" android:endColor="#EAEAEA"
- android:type="linear" android:angle="90"
- android:centerX="0.5" android:centerY="0.5" />
- <corners
- android:topLeftRadius="5dip"
- android:topRightRadius="5dip"
- android:bottomLeftRadius="5dip"
- android:bottomRightRadius="5dip" />
- </shape>
- </item>
-
- </layer-list>