【问题标题】:Navigation view fires an error message [duplicate]导航视图触发错误消息[重复]
【发布时间】:2016-03-04 05:25:27
【问题描述】:

我正在尝试使用导航抽屉。

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

【问题讨论】:

    标签: android navigationview


    【解决方案1】:

    build.gradle中包含设计库

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-28
      • 1970-01-01
      • 2014-05-03
      相关资源
      最近更新 更多