More MenuItems shown than needed after rotation in Android -
I have an app (for 4.0 and above) in which So the problem happens ... If I launch the app in landscape, When I rotate the landscape from the picture, the As you can see, they show more icons than they look like Give, i.e. title bar and tab menu (nav Has not left any space for Geshn menu). Actually, 4 items are shown in portrait mode (this is a separate actionbase) and it seems Android does not know that there is no split actionbare now. Please suggest that what can I do to fix this? :) My menu.xml: An important feature for menu items is XML, Android: showAsAction, which defines The visibility of the action object is clear from your code that if there is room in the action bar then it will be displayed. So if you do not want to specify this Android: showAsAction value never be that whatever the orientation is, it will only appear in the overflow menu. MenuItem s
Actionbar (with one more 'always' and 'ifRoom' or 'never' property).
actionbars resembles the following:
Edit
Menu xmlns: android = "http://schemas.android. Com / apk / res / android "& gt; & Lt; item android: id = "@ + id / action_share" Android: icon = "@drawable / ic_menu_share" android: showAsaction = "always" Android: title = "@ string / share" /> Android: Android: showAsAction = "ifroom" Android: title = "@ string / switch_view" /> & lt; Item android: id = "@ + id / action_upload" Android: icon = "@drawable / ic_manu_upload" Android: showAsAction = "ifRoom" Android: title = "@ string / upload" /> & Lt; Item android: id = "@ + id / action_new" folder: Android: icon = "@ drawable / ic_manu_n_folder" android: showAsAction = "ifRoom" Android: title = "@ string / create_folder" /> & Lt; Item android: id = "@ + id / action_multiselect" Android: icon = "@drawable / ic_manu_septicle" Android: showAsAction = "ifRoom" Android: title = "@ string / selection_mode" /> & Lt; Item android: id = "@ + id / action_refresh" Android: icon = "@drawable / ic_menu_reference" Android: showAsAction = "ifRoom" Android: title = "@ string / refresh" /> & Lt; item android: id = "@ + id / action_settings" Android: icon = "@drawable / ic_menu_settings" android: showAsAction = "never" android: title = "@ string / action_settings" /> & Lt; / Menu & gt;
Comments
Post a Comment