所以,如果我有shape
:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners
android:radius="10dp"/>
</shape>
我希望在selector
:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/someDrawable" android:state_focused="true" android:state_pressed="true"/>
<item android:drawable="@drawable/someOtherDrawable" android:state_focused="false" android:state_pressed="true"/>
<item android:drawable="@drawable/someOtherOTHERDrawable"/>
</selector>
我如何在选择器中使用我的形状并设置它的颜色?甚至可以在XML中做什么?我是否必须使用<include />
标记,如下所示:
<item >
<include layout="@drawable/myShape"
android:color="#987" />
</item>