1 year ago
#370606
newsworthy
Android action bar overflow is inconsistent based on device orientation
I have an action bar item set up to only show if there is room. When clicking onto the problematic screen when the device is in a vertical orientation, the item does not appear in the action bar. Rotating the device to a horizontal orientation does not make the icon appear as well. The menu bar item remains in the overflow menu.
However, if I click onto the problematic screen while the device is in a horizontal orientation, the menu bar item now appears. When rotating the device back to a portrait orientation, the menu bar item continues to appear.
There is an inconsistent experience on whether or not an action button appears in the menu bar or the overflow menu. There clearly is room for the menu bar item in both the vertical and horizontal orientations, however it seems that only an initially horizontal orientation sends the signal that there is room. The problem is, a user could be viewing the same screen horizontally and either have the menu bar item or not based on their device's initial orientation when clicking onto the screen, creating an inconsistent experience. How would I go about solving this?
Here is the relevant code that I would expect to update the menu bar every time the device is rotated:
@Override
public void onConfigurationChanged(Configuration config) {
super.onConfigurationChanged(config);
supportInvalidateOptionsMenu();
}
android
user-interface
menu
android-actionbar
android-menu
0 Answers
Your Answer