2
我想更改標籤的背景。我在過去的2天裏嘗試了一切,所以我決定在這裏發佈我的代碼。 ActionBar的背景設置正確,但TABS保持黑色。無法使用ActionBarSherlock更改標籤的背景
<style name="CustomActivityTheme" parent="Theme.Sherlock">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionBarTabStyle">@style/MyActionBarTabStyle</item>
<!-- other activity and action bar styles here -->
</style>
<!-- style for the action bar backgrounds -->
<style name="MyActionBar" parent="Widget.Sherlock.ActionBar">
<item name="android:background">@drawable/backgroundactionbar</item>
</style>
<style name="MyActionBarTabStyle" parent="Widget.Sherlock.ActionBar.TabView">
<item name="android:background">@drawable/backgroundactionbar</item>
</style>
在清單:
<activity android:name=".FragmentActivityDashboard"
android:label="@string/app_name"
android:configChanges="keyboardHidden|orientation|screenLayout"
android:theme="@style/CustomActivityTheme"
>
</activity>
最後我發現了這個例子。我不明白爲什麼他們必須這麼努力地做到這一點...... – Nestor 2013-06-17 08:52:32
我同意。對UI的這些調整中的一些肯定比他們更容易。 – Tastybrownies 2014-02-23 21:04:49