Android

NavigationView设置监听器无效解决

2017-05-07  本文已影响0人  巨蟹豆浆油条啦

NavigationView设置监听器无效解决

<?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:id="@+id/main_drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".mvp.view.activity.MainActivity"
    >

  <android.support.design.widget.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:clipToPadding="true"
      android:fitsSystemWindows="true"
      >

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar_main"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:navigationIcon="@mipmap/ic_reorder_black_24dp"
        >
    </android.support.v7.widget.Toolbar>

    <FrameLayout
        android:padding="5dp"
        android:id="@+id/mainFrame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        ></FrameLayout>

  </android.support.design.widget.AppBarLayout>


  <android.support.design.widget.NavigationView
      android:id="@+id/nav_main"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:fitsSystemWindows="true"
      app:headerLayout="@layout/headlayout"
      app:itemBackground="?android:attr/selectableItemBackground"
      app:menu="@menu/navmenu"
      ></android.support.design.widget.NavigationView>

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


上一篇 下一篇

猜你喜欢

热点阅读