我在这里遇到了几个对我来说毫无意义的错误:
这是代码:
<?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"
android:id="@+id/DrawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/ToolbarLayout">
<include
android:id="@+id/Toolbar" android:layout="@layout/Toolbar"/><!-- AVAILABLE HERE --><!-- app:layout_scrollFlags="scroll|enterAlways"-->
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/ContentFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/ToolbarLayout"/>
</RelativeLayout>
<android.support.design.widget.NavigationView
android:id="@+id/NavView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:headerLayout="@layout/Toolbar"
app:menu="@menu/Toolbar" /> <!-- NOT AVAILABLE HERE -->
<!--app:headerLayout="@layout/NavHeader"
app:menu="@menu/NavMenu"
android:layout_gravity="start"-->
</android.support.v4.widget.DrawerLayout>
这是错误列表:
正如您所看到的,工具栏清楚地存在,因为它在包含标记中被引用,但是在使用应用程序命名空间的两个属性中不可用。
有人知道这是怎么回事吗?
最佳答案
资源名称中不能有大写字母。所以在这种情况下,我需要将 Toolbar.axml 更改为 toolbar.axml
在 xamarins 票务系统中找到的资源 https://bugzilla.xamarin.com/show_bug.cgi?id=36821
关于android - 无法从 apk/res-auto 命名空间访问项目资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45515754/