2016-03-04 74 views
0

我试图使用导航抽屉。导航视图激发错误消息

我的XML代码如下,

`

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/toolbar" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/orange" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
    app:title="Drawer With Swipe Tabs" /> 

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/drawerLayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 


    <FrameLayout 
     android:id="@+id/containerView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"></FrameLayout> 


    <android.support.design.widget.NavigationView 

     android:id="@+id/shitstuff" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:layout_marginTop="-24dp" 
     app:itemTextColor="@color/black" 
     app:menu="@menu/drawermenu" /> 



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

`

它引发以下的错误消息。

二进制XML文件行#30:错误充气类 android.support.design.widget.NavigationView

回答

2

包括设计库中build.gradle

compile 'com.android.support:design:23.2.0'