【发布时间】:2014-03-21 21:26:52
【问题描述】:
需要帮助
我只是无法让我的标题栏/操作栏将颜色更改为红色 (#ff0000),它始终保持灰色。
样式:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ThemeSelector" parent="android:Theme.Holo.Light">
<item name="android:actionBarStyle">@style/ActionBar</item>
</style>
<style name="ActionBar" parent="android:style/Widget.Holo.ActionBar">
<item name="android:background">#ff0000</item>
</style>
</resources>
更新:(主祭)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.twostarii.actionbardemo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/ThemeSelector" >
<activity
android:name="com.twostarii.actionbardemo.MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
【问题讨论】:
-
您是否将样式应用于清单文件中的活动?
-
是的,当我删除行时它可以工作:android:theme="@android:style/Theme" > 但是当我插入上面的行以便我的图像可以显示时,我得到一个错误:"你不能将自定义标题与其他标题功能结合起来”顺便说一下,我的背景图片在标题栏/操作栏上很好,我想更改标题栏/操作栏的唯一原因是因为我的标题栏图片无法填充父级,有一点两侧以及顶部和底部的灰色阴影,所以我想更改标题栏颜色以与背景图像混合。
-
我认为你没有将样式应用到活动中
-
您有背景可绘制对象并且您想更改操作栏的颜色吗?我认为两者都不可能