我试图将启动图像添加到我的android应用程序的自定义标题栏中,但是当我运行该应用程序时它不会显示。android在标题栏中没有图标
这里是我的自定义样式代码:
customised_style.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="CustomWindowTitleText" parent="android:TextAppearance.WindowTitle">
<item name="android:textSize">20dip</item>
<item name="android:textColor">#e7f4fb</item>
<item name="android:textStyle">bold</item>
</style>
<style name="CustomWindowTitleBackground">
<item name="android:background">#b5b1b4</item>
<item name="android:icon">@drawable/ic_launcher</item>
</style>
<style name="CustomWindowTitle">
<item name="android:textAppearance">@style/CustomWindowTitleText</item>
<item name="android:shadowDx">2</item>
<item name="android:shadowDy">2</item>
<item name="android:shadowRadius">7</item>
<item name="android:shadowColor">#e32020</item>
</style>
<style name="CustomTheme" parent="android:Theme">
<item name="android:windowTitleSize">40dip</item>
<item name="android:windowTitleStyle">@style/CustomWindowTitle</item>
<item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
</style>
,这里是在Android清单文件中定义的自定义应用程序。
AndroidManifest.xml中
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.javapapers.android.sqlitestorageoption"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomTheme" >
<activity
android:name="com.javapapers.android.sqlitestorageoption.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>
<activity
android:name="com.javapapers.android.sqlitestorageoption.NewAnimal"
android:label="" >
</activity>
<activity
android:name="com.javapapers.android.sqlitestorageoption.EditAnimal"
android:label="" >
</activity>
</application>
任何人都可以找出什么,我缺少的,这样我可以纠正错误并运行该图标的应用程序?的回答
试试这个例子:[如何创建自定义标题栏](http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/) – SelvaMariappan 2013-03-23 12:39:20