Find out if ActionBar is stacked

前端 未结 3 2104
[愿得一人]
[愿得一人] 2020-12-30 01:42

If you add tabs to your ActionBar, they will be in an extra stacked ActionBar on phones in portrait mode. Is there an easy way to find out whether

3条回答
  •  误落风尘
    2020-12-30 02:07

    This behavior is called Split Action Bar. It happens when the AndroidManifest is set with uiOptions="splitActionBarWhenNarrow" in the or element.

    Android adjusts the action bar's appearance in a variety of ways, based on the current screen size. Using split action bar is just one option that you can enable to allow the action bar to further optimize the user experience for different screen sizes. In doing so, you may also allow the action bar to collapse navigation tabs into the main action bar. That is, if you use navigation tabs in your action bar, once the action items are separated on a narrow screen, the navigation tabs may be able to fit into the main action bar rather than be separated into the "stacked action bar".

    Mock-ups of split action bar with navigation tabs on the left; with the app icon and title disabled on the right.

    You can get more details here.

提交回复
热议问题