In your layout, you can change the BottomAppBar theme to this:
<android.support.design.bottomappbar.BottomAppBar
...
android:theme="@style/Widget.MaterialComponents.BottomAppBar"
/>
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>
It's better to use Theme.MaterialComponents
themes as application parent theme when you use Google Material components:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
instead of :
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
in style.xml
I have also got the same issue, but found a solution by adding:
style="@style/Widget.MaterialComponents.BottomAppBar"
for bottomBar.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.