[英]hiding bottom navigation view when open slide menu
我的项目中有一个bottom navigation view
,有 2 个fragments
,每个片段都有一个slide menu
( navigation view
),我想在bottom navigation view
任何菜单时隐藏bottom navigation view
,有人能给我一个例子吗? ?如果有类似的问题,如果你能告诉我,我会很高兴,因为我没有发现任何类似的问题
if your layout like this :如果你的布局是这样的:
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:id="@+id/drawer_layout"
tools:openDrawer="start"
android:layout_height="match_parent"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="?attr/actionBarSize">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:menu="@menu/buttom_nav_menu"/>
</RelativeLayout>
<com.google.android.material.navigation.NavigationView
android:layout_gravity="start"
app:menu="@menu/menu"
android:layout_width="330dp"
android:layout_height="match_parent"/>
</androidx.drawerlayout.widget.DrawerLayout>
you will not need to hide the bottom navigation view
because the slide menu is in front of it您不需要隐藏
bottom navigation view
因为滑动菜单在它前面
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.