我正在使用android.support.widget.TabLayoutTab视图,我想从代码(而不是从xml或通过样式)更改选定的选项卡文本颜色.我怎样才能做到这一点 ?
如何更改选项卡文本指示器的颜色?我可以使用选择标签更改图标参考示例.但不能文字颜色.怎么样?
我正在尝试在按下时将背景颜色更改为菜单项.按下时更改背景颜色,但不更改颜色.
WHISED:
获得:
我可以做什么?谢谢

Styles.xml
<style name="AppTheme2" parent="android:Theme.Holo">
<item name="android:popupMenuStyle">@style/MyApp.PopupMenu</item>
</style>
<style name="MyApp.PopupMenu" parent="android:Widget.Holo.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_item_selector</item>
</style>
Run Code Online (Sandbox Code Playgroud)
menu_item_selector.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/menu_item_fondo_pressed" android:state_focused="true"/>
<item android:drawable="@drawable/menu_item_fondo_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/menu_item_fondo"/>
</selector>
Run Code Online (Sandbox Code Playgroud)