导航视图会触发错误消息

时间:2016-03-04 05:25:28

标签: android navigationview

我试图使用导航抽屉。

我的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

1 个答案:

答案 0 :(得分:2)

build.gradle

中加入设计库

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