[英]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.