adapter.addTab(getSupportActionBar().newTab().setText("Tab-1"),
Tab1.class, null);
adapter.addTab(getSupportActionBar().newTab().setText("Tab-2"),
Tab2.class, null);
adapter.addTab(getSupportActionBar().newTab().setText("Tab-3"),
Tab3.class, null);
到目前为止,每个选项卡的 TextColor 都为白色。我希望它在未选中时为灰色,在选中时为白色。那么,如何更改onTabSelected或onTabUnselected中的文本颜色。
还是我应该使用 setCustomView 作为选项卡?这里又是 TextSize 和所有需要照顾的
<style name="my_ActionBarTabStyle" parent="@style/Widget.Sherlock.ActionBar.TabView">
<item name="background">@drawable/tab_indicator_ab_wicfy</item>
<item name="android:background">@drawable/tab_indicator_ab_wicfy</item>
<item name="android:textColor">@color/black</item>
</style>
我试着用
<item name="textColor">@color/black</item>
但它给了我一个错误,即textColor不是一个有效的属性
谢谢你