左右 Space 问题的底部导航视图
Bottom Navigation View With Left Righ Space Issue
我是 android 的新手,我使用带有两个菜单的底部导航视图
但我正在向左向右space
这是我的导航视图,
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:itemBackground="@color/colorRed"
app:itemIconTint="@color/colorWhite"
app:itemTextColor="@color/colorWhite"
app:menu="@menu/bottom_bar_menu"/>
请检查图像
根据Material设计指南
您不能将两个菜单与底部导航一起使用,而不是 bottomNavigation 视图使用选项卡布局
检查此 link 以获取指南 https://material.io/guidelines/components/bottom-navigation.html#bottom-navigation-usage
不过,如果您想使用底部导航视图
在 BottomNavigationView
中试试这个
android:background="@color/colorRed"
如果目的地少于三个,请考虑改用标签。
在底部
解决方案
在 BottomAppBar 内部设置属性
android:padding="0dp"
我是 android 的新手,我使用带有两个菜单的底部导航视图
但我正在向左向右space
这是我的导航视图,
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:itemBackground="@color/colorRed"
app:itemIconTint="@color/colorWhite"
app:itemTextColor="@color/colorWhite"
app:menu="@menu/bottom_bar_menu"/>
请检查图像
根据Material设计指南 您不能将两个菜单与底部导航一起使用,而不是 bottomNavigation 视图使用选项卡布局 检查此 link 以获取指南 https://material.io/guidelines/components/bottom-navigation.html#bottom-navigation-usage
不过,如果您想使用底部导航视图
在 BottomNavigationView
中试试这个android:background="@color/colorRed"
如果目的地少于三个,请考虑改用标签。 在底部
解决方案
在 BottomAppBar 内部设置属性
android:padding="0dp"