【发布时间】:2021-08-13 18:37:23
【问题描述】:
将bottomNavigationView 与单一活动方法一起使用的最佳方式是什么。 我找到了导航架构组件的示例,但我不想使用导航组件。
例如,我有一个activity和3个fragment用于bottomNavigationView,其他6个fragment应该不包括菜单。这是我的底部导航视图:
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigationView"
android:layout_width="match_parent"
app:menu="@menu/bottom_navigation"
android:layout_alignParentBottom="true"
android:layout_height="wrap_content"/>
我应该怎么做,只在三个片段中添加菜单,在需要的地方,或者向活动添加一个菜单并在不需要菜单的地方显示片段时隐藏它?请帮我弄清楚)
【问题讨论】:
标签: android android-activity fragment bottomnavigationview