我设置颜色为白色,但它不会改变: activity_my.xml:更改android动作栏颜色?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MyActivity"
android:theme="@style/AppTheme">
</RelativeLayout>
style.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/ActionBar</item>
</style>
<style name="ActionBar">
<item name="android:background">#ffffff</item>
</style>
</resources>
AndroidManifest.xml中
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.test.test.test" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MyActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我已经搜索,但到处都是这样解释。
我已经添加了androidmanifest文件。
ActionBar bar = getActionBar(); bar.setBackgroundDrawable(new ColorDrawable(“COLOR”)); – 2014-11-05 11:14:41
它返回的错误不能应用于此颜色 - #ffffff或rgb变体。 – emanuilov 2014-11-05 11:18:59
使用sharelack活动对简单活动 – 2014-11-05 11:20:30