recently I've switched from the regular action bar implementation to the recently released appcompat implementation. My app made heavy use of the action bar to provide functionality. Since switching, on older spots APIs (less than 11) don't have any menu items. And newer APIs do, but they don't show the image like configured (if room|withText). Has anyone else experienced this or came up with any solutions?
相关问题
- 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 there is a physical "Menu" button on device, it will show the contextual menu. If not, the menu item will be added to the ActionBar.
I found out what was up, when using the appcompat library. You can create your menu just like normal.
But, in your menu xml files, add a xmlns:app attribute to the menu tag, like so:
then, in each of your menu items, where you usually specify the "showAs" style (ifRoom, withText, etc.), include this alternative line alongside the regular one:
After this, your menus will show correctly on both current and old APIs. I got this information from here.