1

I have a similar problem as found on this specific question.

I'm using a Toolbar from the v7 support library, and a custom layout. If I have no options menu, I have a result similar to what OP has on the question linked above:

Result with no options menu

However if I have an options menu, it shifts the toolbar a little bit to the left (start). I would like to have it over the toolbar.

Result with an options menu

Is it possible? The only way I could hack it is by adding a negative right (end) margin to the toolbar layout, however this moves the menu outside of the screen…

Community
  • 1
  • 1
Benoit Duffez
  • 11,839
  • 12
  • 77
  • 125

1 Answers1

0

Initially, the whole Toolbar contained several views, so they had to share the width with the action menu.

Now instead I wrapped the Toolbar and the other views in a container (a FrameLayout), so that they overlap without sharing the width. I just need to be careful with the margin at the top so that the other views don't overlap with action icons.

Benoit Duffez
  • 11,839
  • 12
  • 77
  • 125