[英]Bottom app bar Navigation icon is not center vertical
在您的布局中,您可以将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"
对于底部栏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.