3
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);
截至目前,每個Tab都將其TextColor設置爲白色。我希望它在未選中時變成灰色,並在選中時變成白色。那麼,如何更改onTabSelected或onTab未選中中的文字顏色。如何更改ActionBarSherlock選項卡文本顏色?
或者我應該與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>
我試圖用
,但它給了我錯誤文字顏色是不是一個有效的屬性
謝謝
就像在問題1? –
反正不行:( –
你必須把它加到'res/color'中,並把它作爲'@ color/tab_text_indicator'引用。當預期顏色時不能使用drawable – Tomik