【发布时间】:2016-01-16 22:27:45
【问题描述】:
我的 Android 应用程序的操作栏不显示“AndroidManifest.xml”标签中定义的图标,我也无法更改操作栏的颜色或操作标题文本的颜色等内容吧。
我目前使用的最低 API 为 16(Android Jellybean 4.1),目标 SDK 为最新(在撰写本文时)为 22。
我的样式.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/ActionBar</item>
</style>
<style name="ActionBar" parent="Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:background">#006699</item>
</style>
</resources>
我的 AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="PACKAGE_NAME" >
<application
android:allowBackup="true"
android:icon="@drawable/logo_custom"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:logo="@drawable/logo_custom"
android:name=".MainActivity"
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>
每当我在手机上测试应用程序(运行 4.4.4 KitKat API 19)时,我都会得到默认的黑色操作栏,没有应用程序图标。
有人知道为什么不能自定义吗?
感谢所有帮助,在此先感谢。
注意:我是 Android 开发新手。
【问题讨论】:
标签: android xml android-actionbar android-4.4-kitkat