【问题标题】:ActionBar disappears when changing background color更改背景颜色时,ActionBar 消失
【发布时间】:2014-03-05 19:58:16
【问题描述】:

我已将 values-v14 中的 styles.xml 修改为:

<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/BlueWhiteActionBarTheme</item>
</style>

<style name="BlueWhiteActionBarTheme" parent="AppBaseTheme">
    <item name="android:background">#0089CD</item>
</style>

但是如果我用这个修改运行应用程序,ActionBar 就会消失,有人知道我做错了什么吗?

【问题讨论】:

    标签: android xml styles android-actionbar themes


    【解决方案1】:

    改成

      <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
             <item name="android:actionBarStyle">@style/BlueWhiteActionBarTheme</item>
      </style>
    
     <style name="BlueWhiteActionBarTheme" parent="@android:style/Widget.Holo.Light.ActionBar">
         <item name="android:background">#0089CD</item>
     </style>  
    

    并应用于活动

     android:theme="@style/BlueWhiteActionBarTheme"
    

    【讨论】:

      猜你喜欢
      • 2013-03-03
      • 2015-08-14
      • 1970-01-01
      • 2015-07-25
      • 1970-01-01
      • 2015-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多