我有一个actionBar,我希望文本颜色根据每个menuItem所处的状态而改变。
我已经创建了我的选择器和颜色资源,我只是不确定如何使用我的actionBar来实现它。
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/pink" android:state_pressed="true" />
<item android:color="@color/blue" android:state_focused="true" />
<item android:color="@color/yellow" />
</selector>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red">#ff0000</color>
<color name="green">#7AB800</color>
<color name="blue">#00B0CA</color>
<color name="yellow">#FDC82F</color>
<color name="pink">#DC0451</color>
<color name="orange">#F78F1E</color>
<color name="white">#FFFFFF</color>
</resources>