I have a menu, which contain an item with an icon that comes with sdk (from skd/platform/...). In ICS it's displayed fine (dark action bar, light color icon), but in android 2.2, you can't see the icon because the default theme is white and so is the icon. Is there a way to access android default icons, like when using the search bar, the icon is displayed correctly on all android versions? Is there a way to access android default icons?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
If you are defining your menu in an XML, then something like this will ensure the icons are always picked up from the corresponding SDK drawables.
If you are adding your Menu Items in your Java code, something like this should do it:
Note: You should check if the icons you intend to use are common across all platforms to ensure a uniform and error free functioning for your users.
Yes here os a menu item using the android preferences/settings icon as it's icon.
For a full list of the icons look at the documentation for the R.drawable class.
http://developer.android.com/reference/android/R.drawable.html
For an app that views all of the icons see How to preview R.drawable.* images
First add actionOverFlowButtonStyle into your main theme
Define the New style for action over flow button