xml中设置圆角矩形

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

猜你在找的XML相关文章