【发布时间】:2018-05-15 21:13:59
【问题描述】:
我目前正在使用 xamarin 开发一个 android 核心应用程序,我已经安装了 android support design 23.4.0.1 和 Android.Support.v7.AppCompat 23.4.0.1
我现在遇到的问题是:
app:headerLayout="@layout/nav_header"
app:menu="@layout/menu_navigation"
出现错误“未找到包中属性的资源标识符”
我正在阅读这里已经回答的一些问题,但仍然无法修复错误,可能是因为我使用的是 xamarin,我不知道。
有问题的完整代码:
<?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/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.learn2crack.myapplication.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" />
</android.support.design.widget.AppBarLayout>
<include
layout="@layout/listitem_device" />
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_gravity="start"
app:headerLayout="@layout/nav_header"
app:menu="@layout/menu_navigation"/>
</android.support.v4.widget.DrawerLayout>
注意:我使用的是本教程:https://www.learn2crack.com/2016/03/android-material-design-sliding-navigation-drawer.html
【问题讨论】: