我如何改变羽绒ActionBar的风格?

时间:2013-02-28 17:41:40

标签: android actionbarsherlock

我正在使用ActionBarSherlock,我的应用程序将安装在多种智能手机上,对于小型智能手机,我将动作栏分开:

android:uiOptions="splitActionBarWhenNarrow"

我的问题出现在分割栏时,因为样式只保留在顶栏(绿色)上,而不是在按钮栏上(灰色):P

这是截图:

enter image description here

我目前的风格:

<resources xmlns:android="http://schemas.android.com/apk/res/android">

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="Theme.Sherlock.Light">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    <item name="android:textViewStyle">@style/label</item>
    <item name="android:checkboxStyle">@style/checkbox</item>
    <item name="android:buttonStyle">@style/boton</item>
    <item name="android:starStyle">@style/star</item>
    <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
    <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>

    <!-- Agregamos algunos estilos para ver como cambiar los colores de la barra -->
    <item name="android:actionDropDownStyle">@style/Widget.Styled.ActionBar</item>
    <item name="actionDropDownStyle">@style/Widget.Styled.ActionBar</item>
    <item name="actionBarSplitStyle">@style/Widget.Styled.ActionBar</item>
    <item name="android:actionBarSplitStyle">@style/Widget.Styled.ActionBar</item>
</style>

<style name="label" parent="android:style/Widget.TextView">
    <item name="android:padding">4dp</item>
    <item name="android:textColor">#DF0101</item>
    <item name="android:textSize">20sp</item>
</style>

<style name="checkbox" parent="android:style/Widget.CompoundButton.CheckBox">
    <item name="android:textColor">#DF0101</item>
    <item name="android:textSize">20sp</item>
</style>

<style name="boton" parent="android:style/Widget.Button">
    <item name="android:background">@drawable/btn_form</item>
    <item name="android:textColor">#ffffff</item>
    <item name="android:textSize">20sp</item>
</style>

<style name="star" parent="android:style/Widget.CompoundButton.Star">
    <item name="android:textColor">#DF0101</item>
    <item name="android:textSize">20sp</item>
</style>

<style name="Widget.Styled.ActionBar"
       parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
    <item name="background">@drawable/background</item>
    <item name="android:background">@drawable/background</item>
    <item name="android:backgroundStacked">@drawable/background</item>
    <item name="android:backgroundSplit">@drawable/background</item>
    <item name="android:actionButtonStyle">@drawable/background</item>
</style>

</resources>

此组件的名称是什么,以便将其添加到样式表?

1 个答案:

答案 0 :(得分:1)

我的问题是我忘记了这个参数:

<item name="backgroundSplit">@drawable/background</item>

只放了这个:

<item name="android:backgroundSplit">@drawable/bg_actionbar</item>

抱歉:P