Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bottom app bar Navigation icon is not center vertical

I'm using android.support.design.bottomappbar.BottomAppBar but the navigation icon is coming in left top corner when option menu is added.

without Option its working as expected (center_vertical).

With option menu

enter image description here

Without Option Menu

enter image description here

Can any one tell how to fix it?

like image 689
Neeraj Kumar Avatar asked May 14 '18 07:05

Neeraj Kumar


2 Answers

In your layout, you can change the BottomAppBar theme to this:

<android.support.design.bottomappbar.BottomAppBar
    ...
    android:theme="@style/Widget.MaterialComponents.BottomAppBar"
/>
like image 79
Mahozad Avatar answered Sep 25 '22 17:09

Mahozad


After trying different ways, setting padding through styles worked.

<style name="NavButtonPadding" parent="@android:style/Widget.ActionButton">
    <item name="android:paddingStart">10dp</item>
    <item name="android:paddingEnd">10dp</item>
    <item name="android:minWidth">10dp</item>
</style>

After Adding styles

like image 21
Neeraj Kumar Avatar answered Sep 22 '22 17:09

Neeraj Kumar