第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

單擊事件關(guān)閉導(dǎo)航抽屜

單擊事件關(guān)閉導(dǎo)航抽屜

智慧大石 2022-12-28 10:37:56
我無法單擊我的任何菜單項,我無法從右向左滑動以關(guān)閉抽屜,但是,無論何時打開并單擊屏幕,它都會立即關(guān)閉。
查看完整描述

1 回答

?
哆啦的時光機

TA貢獻1779條經(jīng)驗 獲得超6個贊

在BottomActivity中將此添加到您的onCreate中:


    NavigationView nav_view;


    nav_view = findViewById(R.id.nav_view);   //select nav_view from activity_drawer_layout


    nav_view.setNavigationItemSelectedListener(this);

在activity_drawer_layout.xml中,將NavigationView放在DrawerLayout的結(jié)束標(biāo)記上方。


<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.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:layout_height="match_parent"

tools:context=".DrawerLayout"

android:id="@+id/DrawerLayout">


<include

    android:id="@+id/include"

    layout="@layout/app_bar_nav_drawer"

    android:layout_width="0dp"

    android:layout_height="0dp" />

<LinearLayout

    android:id="@+id/linearLayout"

    android:layout_width="0dp"

    android:layout_height="673dp"

    android:padding="16dp"

    android:orientation="vertical">


    <android.support.v7.widget.CardView

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:id="@+id/cv">


        <RelativeLayout

            android:layout_width="match_parent"

            android:layout_height="wrap_content">


            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:id="@+id/name" />


            <TextView

                android:layout_width="wrap_content"

                android:layout_height="wrap_content"

                android:id="@+id/age"/>

        </RelativeLayout>


    </android.support.v7.widget.CardView>


</LinearLayout>


<android.support.v7.widget.CardView

    xmlns:card_view="http://schemas.android.com/apk/res-auto"

    android:id="@+id/cardView"

    android:layout_width="match_parent"

    android:layout_height="wrap_content"

    card_view:layout_constraintBottom_toBottomOf="@+id/nav_header" />


<include

    android:id="@+id/include"

    layout="@layout/app_bar_nav_drawer"

    android:layout_width="wrap_content"

    android:layout_height="wrap_content" />


<android.support.design.widget.NavigationView

    android:id="@+id/nav_view"

    android:layout_width="wrap_content"

    android:layout_height="match_parent"

    android:fitsSystemWindows="true"

    android:layout_gravity="start"

    android:clickable="true"

    android:focusable="true"

    android:orientation="vertical"

    app:headerLayout="@layout/nav_header_nav_drawer"

    app:menu="@menu/activity_nav_drawer_drawer" />



</android.support.v4.widget.DrawerLayout>


查看完整回答
反對 回復(fù) 2022-12-28
  • 1 回答
  • 0 關(guān)注
  • 124 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號