2013-05-10 72 views
0

为了让操作栏蓝我一直在使用下面的代码:ActionBarSherlock背景样式

com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater(); 
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00BFFF"))); 

但代码似乎并没有太大的用场,当用户切换到其他一些筛选出的应用程序的控制。我试着使用style属性

<item name = "android:background">#00BFFF</item> 

但是,这打乱了应用程序的整体显示。有什么我失踪?有人可以提出这个建议吗?我如何实现actionbarsherlock背景?

回答

0

应用像这样在你的styles.xml

<!-- "Implementation" of our ABS custom theme --> 
    <style name="Widget.Styled.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse"> 
     <item name="titleTextStyle">@style/TitleText</item> 
     <item name="android:background">@drawable/ab_background</item> 
     <item name="background">@drawable/ab_background</item> 
     <item name="android:titleTextStyle">@style/TitleText</item> 
    </style> 

<item name="background">创建一个可绘制的9补丁的动作条的背景。