我想更改BottomNavigationView
高度和更改尺寸后项目位置不会改变。
这更像是中间的间隙不会自动改变。但是,我想更改这个间隙大小。
This is
Before
change height and item sizes. These gap sizes are fine with these items but making item smaller it will make a UI issue.
这是我的代码:
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
style="@style/MyBottomNavigationView"
android:layout_width="0dp"
android:layout_height="?android:listPreferredItemHeightSmall"
android:background="?android:attr/windowBackground"
app:itemIconSize="20dp"
app:labelVisibilityMode="labeled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
我也在使用<com.google.android.material.bottomnavigation.BottomNavigationView ...
如果你们知道更好的库,请推荐我。
最佳答案
通过覆盖以下尺寸来更改 BottomNavigationView
的高度
<dimen name="design_bottom_navigation_height" tools:override="true">40dp</dimen>
这将增加/减少图标和文本之间的间隙大小。
关于android - BottomNavigationView:更改标题和图标之间的间隙大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66570683/