ActionBar with custom layout does not occupy full screen width on Android 4.4.2 (KitKat)

前端 未结 2 1194
遇见更好的自我
遇见更好的自我 2021-01-13 05:19

I want to display an Action Bar with a custom layout. The custom layout has three ImageViews, one in the centre and the other two on the left & right ends of the action

2条回答
  •  忘掉有多难
    2021-01-13 05:23

    It's not a gap, it's a menu overflow button to the right. If you look closely you can see three dots button.

    You've chosen the wrong theme because you can hardly see it. Use Theme.Compat.Light.DarkActionBar if your ActionBar is dark and you need the light theme.

    On devices that don't have physical menu button (mostly new ones) the menu overflow button is shown.

    You can't remove it unless you disable menus.

    You can use splitActionBarWhenNarrow uiOptions which will split the ActionBar so that the menu part will be at the bottom one, but that will be only for vertical orientation of medium screens and probably not what you need.

    Take a look at the ActionBar Patterns doc and Menus UI doc

提交回复
热议问题