设计Actionbarsherlock选项卡
所以我试图使用ActionBarSherlock库实现我的Actionbar的选项卡。这是我的代码:设计Actionbarsherlock选项卡
<style name="Theme.AndroidDevelopers" parent="Theme.Sherlock.Light.ForceOverflow">
<item name="actionBarTabStyle">@style/CustomActionBarStyle</item>
<item name="android:actionBarTabStyle">@style/CustomActionBarStyle</item>
<style name="CustomActionBarStyle" parent="Widget.Sherlock.Light.ActionBar.TabBar">
<item name="android:background">@drawable/actionbar_tab_bg</item>
</style>
在二,三线,如果我改变actionBarTabStyle到actionBarStyle,我的动作条本身改变我想要的风格(不是很顺利着,当然),这样的连接做的工作。但是,尝试更改操作栏选项卡(位于其下方)仍然没有成功。
我希望有人能帮助我。
与问候,
下面应该工作
<style name="Theme.app" parent="@style/Theme.Sherlock.Light">
<item name="android:actionBarTabBarStyle">@style/Theme.app.tabbar.style</item>
<item name="actionBarTabBarStyle">@style/Widget.app.ActionBar.TabBar</item>
</style>
<style name="Theme.app.tabbar.style" parent="@style/Theme.Sherlock.Light">
<item name="android:background">#FF0000</item>
<item name="background">#FF0000</item>
</style>
<style name="Widget.app.ActionBar.TabBar" parent="Widget.Sherlock.ActionBar.TabBar">
<item name="android:background">#FF0000</item>
<item name="background">#FF0000</item>
</style>
这使得使用TabBar红。
您需要设置两次actionBarTabBarStyle。这是因为Android的> 3.0和Android <的3.0
我在做类似的事情! http://*.com/questions/19623805/actionbarsherlock-stacked-action-bar-styling-issue – toobsco42 2013-10-27 21:33:36
这确实有效。 TY! – 2014-07-01 19:21:38
在你CustomActionBarStyle
你需要有
<item name="android:background">@drawable/actionbar_tab_bg</item>
<item name="background">@drawable/actionbar_tab_bg</item>
希望这有助于:)
感谢您的回复。但是,它仍然不符合你的建议。我真的不知道问题在这里。 – Hidde 2012-04-24 13:40:38
您是否尝试过使用父'Widget.Sherlock.Light.ActionBar.TabView'? – chuckliddell0 2012-04-24 14:27:26
@ chuckliddell0不适用于我 – noloman 2012-06-22 09:06:52
因此,我不得不因为某种方式与造型一些困难,我发现通过代码首先添加的标签。谢谢你的回应,他们都工作。
您是否检查过“style”的开始和结束标记? – 2012-04-24 21:20:05