DawidPi DawidPi - 1 year ago 128
Android Question

Android - non-floating toolbar

my problem is, that with appcompat I am able only to create a toolbar, which is floating. In my scenario this looks pretty ugly. Could not find any tutorial/solution, that would allow to create toolbar a non-floatable one. Do you have any ideas?

My current implementation:



by floating I mean, that it's not aligned to top and right left border. Instead it's just flying attached to nothing.

Floating Toolbar with Appcompat this is a sample with floating toolbar.

https://developer.android.com/training/appbar/index.html in image here here is non-floating toolbar.

Answer Source

Without the complete layout XML, it is hard to provide a good answer, but based on your description of the problem, it sounds like the root layout (or whatever View contains your Toolbar has padding set on it.

Remove all padding from the Toolbar's parent and you should get what you are looking for.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download