定义styles.xml
Xml代码
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <style name="RoundedCornerBtn" parent="RoundedCornerView">
- <item name="android:background">@drawable/roundedcorner_btn</item>
- <item name="android:gravity">left|center_vertical</item>
- <item name="android:textColor">@android:color/black</item>
- </style>
- </resources>
roundedcorner_btn.xml
Xml代码
- <?xml version="1.0" encoding="utf-8"?>
- <selector xmlns:android="http://schemas.android.com/apk/res/android" >
- <item android:state_pressed="true" >
- <shape>
- <stroke android:width="2dp" android:color="@color/orange" />
- <corners android:radius="10dp" />
- <solid android:color="@color/orange"/>
- </shape>
- </item>
- <item android:state_focused="true">
- <shape>
- <stroke android:width="2dp" android:color="@color/light_gray" />
- <corners android:radius="10dp" />
- <solid android:color="@android:color/white"/>
- </shape>
- </item>
- <item >
- <shape>
- <stroke android:width="2dp" android:color="@color/light_gray" />
- <corners android:radius="10dp" />
- <solid android:color="@android:color/white"/>
- </shape>
- </item>
- </selector>
color.xml
Xml代码
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <color name="tabMedium">#2B2B2B</color>
- <color name="tabDark">#000000</color>
- <color name="tabTransparent">#10ffffff</color>
- <color name="trans">#0000</color>
- <color name="gray">#FF999999</color>
- <color name="light_gray">#FFCCCCCC</color>
- <color name="light_blue">#FFC5CCD4</color>
- <color name="blue">#0099FF</color>
- <color name="orange">#fff48b01</color>
- </resources>
这些都是我从项目里面copy出来的,如果有问题可以找我要相应的代码
时间: 2024-10-08 17:10:49