安卓selector
定义styles.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 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 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出来的,如果有问题可以找我要相应的代码
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。