-1
我嘗試了很多方法,但無法在ActionBar中添加徽標。無法在ActionBar,Android API中添加徽標<11
我建立應用程序與minSdkVersion = 9
和targetSdkVersion = 21
,我成功地改變了顏色動作條的,並將其與API < 11工作,但不能添加標誌呢!
我google了很多,也讀了很多回答stackoverflow但沒有任何工作。
我需要在這裏
我厭倦了manifest
文件如添加標識標誌,
<application android:logo="@drawable/ic_launcher">
和
<activity android:logo="@drawable/ic_launcher">
,但它不工作!
我還創建res/values/themes.xml
文件
<style name="CustomActionBarTheme"
parent="@style/Theme.AppCompat">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="actionBarStyle">@style/MyActionBar</item>
</style>
<style name="MyActionBar"
parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:logo">@drawable/ic_launcher</item>
<item name="logo">@drawable/ic_launcher</item> //this is for support v7
</style>