【发布时间】:2012-11-08 11:49:28
【问题描述】:
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 不是有效属性
谢谢
【问题讨论】: