在你的布局中,你可以将 BottomAppBar 主题 改为如下:
<android.support.design.bottomappbar.BottomAppBar
...
android:theme="@style/Widget.MaterialComponents.BottomAppBar"
/>
<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>
当您使用Google Material组件时,最好将Theme.MaterialComponents
主题作为应用程序的父主题:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
替换为:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
style.xml
中。我也遇到了同样的问题,但是通过添加以下内容找到了解决方案:
style="@style/Widget.MaterialComponents.BottomAppBar"
用于底部栏。