这个问题已经有了答案:
How to change the text color of action bar sherlock
3答
我尝试了多种不同的方法将标签文本颜色改为actionbarshelock,但都不起作用。这是我的styles.xml文件。
<style name="Theme.Test" parent="@style/Theme.Sherlock.Light">
<item name="actionBarItemBackground">@drawable/selectable_background_test</item>
<item name="popupMenuStyle">@style/PopupMenu.Test</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Test</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Test</item>
<item name="actionDropDownStyle">@style/DropDownNav.Test</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Test</item>
<item name="actionModeBackground">@drawable/cab_background_top_test</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_test</item>
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Test</item>
<item name="android:actionBarItemBackground">@drawable/selectable_background_test</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Test</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Test</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Test</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Test</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Test</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_test</item>
<item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_test</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Test</item>
</style>
<style name="ActionBar.Solid.Test" parent="@style/Widget.Sherlock.Light.ActionBar.Solid">
<item name="background">@drawable/ab_solid_test</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_test</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_test</item>
<item name="progressBarStyle">@style/ProgressBar.Test</item>
<item name="android:background">@drawable/ab_solid_test</item>
<item name="android:backgroundStacked">@drawable/ab_stacked_solid_test</item>
<item name="android:backgroundSplit">@drawable/ab_bottom_solid_test</item>
<item name="android:progressBarStyle">@style/ProgressBar.Test</item>
<item name="android:titleTextStyle">@style/Test.ActionBar.TitleTextStyle</item>
<item name="titleTextStyle">@style/Test.ActionBar.TitleTextStyle</item>
<item name="actionBarTabTextStyle">@style/MyTabTextStyle</item>
<item name="android:actionBarTabTextStyle">@style/MyTabTextStyle</item>
<item name="android:actionBarStyle">@style/YOURTHEME.ActionBarStyle</item>
<item name="actionBarStyle">@style/YOURTHEME.ActionBarStyle</item>
</style>
<style name="YOURTHEME.ActionBarStyle" parent="Widget.Sherlock.Light.ActionBar">
<item name="android:titleTextStyle">@style/YOURTHEME.ActionBar.TitleTextStyle</item>
<item name="titleTextStyle">@style/YOURTHEME.ActionBar.TitleTextStyle</item>
</style>
<style name="YOURTHEME.ActionBar.TitleTextStyle" parent="TextAppearance.Sherlock.Widget.ActionBar.Title">
<item name="android:textColor">@color/white</item>
</style>
<style name="MyTabTextStyle" parent="style/Widget.Sherlock.Light.ActionBar.TabText">
<item name="android:textColor">@color/white</item>
<item name="android:background">@color/white</item>
</style>
<style name="Test.ActionBar.TitleTextStyle" parent="TextAppearance.Sherlock.Widget.ActionBar.Title">
<item name="android:textColor">@color/white</item>
</style>
<style name="ActionBar.Transparent.Test" parent="@style/Widget.Sherlock.Light.ActionBar">
<item name="background">@drawable/ab_transparent_test</item>
<item name="progressBarStyle">@style/ProgressBar.Test</item>
<item name="android:background">@drawable/ab_transparent_test</item>
<item name="android:progressBarStyle">@style/ProgressBar.Test</item>
</style>
<style name="PopupMenu.Test" parent="@style/Widget.Sherlock.Light.ListPopupWindow">
<item name="android:popupBackground">@drawable/menu_dropdown_panel_test</item>
</style>
<style name="DropDownListView.Test" parent="@style/Widget.Sherlock.Light.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_test</item>
</style>
<style name="ActionBarTabStyle.Test" parent="@style/Widget.Sherlock.Light.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_test</item>
</style>
<style name="DropDownNav.Test" parent="@style/Widget.Sherlock.Light.Spinner.DropDown.ActionBar">
<item name="android:background">@drawable/spinner_background_ab_test</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_test</item>
<item name="android:dropDownSelector">@drawable/selectable_background_test</item>
</style>
<style name="ProgressBar.Test" parent="@style/Widget.Sherlock.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/progress_horizontal_test</item>
</style>
<style name="ActionButton.CloseMode.Test" parent="@style/Widget.Sherlock.Light.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_test</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Test.Widget" parent="@style/Theme.Sherlock">
<item name="popupMenuStyle">@style/PopupMenu.Test</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Test</item>
<item name="android:popupMenuStyle">@style/PopupMenu.Test</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Test</item>
</style>
我想把我的文字改成白色,但我不知道如何做到这一点。如果有人能帮我,我将不胜感激。
谢谢!
最佳答案
我已经开始工作了。
这应该是主题
<item name="actionBarTabTextStyle">@style/tabtextcolor</item>
<item name="android:actionBarTabTextStyle">@style/tabtextcolor</item>
这应该是定义选项卡文本颜色的地方。
<style name="tabtextcolor" parent="@style/Widget.Sherlock.ActionBar.TabText">
<item name="android:textColor">@android:color/white</item>
</style>