Issue
In my application I use light Action Bar in which I place icons of menu items. So, these icons are black, but in Android Gingerbread (and lower) menus are displayed in black background. I need to use a white version of the icons in that case. I placed white icons in res/drawable
and black icons in res/drawable-v11
:
└── res
├── drawable
│ ├── ic_action_auth.png
│ ├── ic_action_refresh.png
│ └── ic_action_web.png
└── drawable-v11
├── ic_action_auth.png
├── ic_action_refresh.png
└── ic_action_web.png
Running my app in a Jelly Bean emulator, icons are correctly displayed in black (so drawable-v11
is used, as expected). But in the Gingerbread emulator, icons are displayed in black too, and I can't get why. I don't know what details I can give you more. This is one of the menus I created, the single version of the resource res/menu/menu.xml
:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@id/action_refresh"
android:icon="@drawable/ic_action_refresh"
android:orderInCategory="100"
android:showAsAction="always"
android:title="@string/action_refresh"/>
<item
android:id="@+id/action_auth"
android:icon="@drawable/ic_action_auth"
android:orderInCategory="101"
android:showAsAction="always"
android:title="@string/auth"
android:titleCondensed="@string/auth_condensed">
</item>
</menu>
Solution
Try making another drawable folder: res/drawable-hdpi-v11
Another option would be to use ActionBarSherlock so your app can have an ActionBar on older versions of Android. That's what I would recommend, personally.
Answered By - Karakuri
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.