[英]when using a custom namespace attribute in a library project, use the namespace “http://schemas.android.com/apk/res-auto” instead
[英]cannot access project Resources from apk/res-auto namespace
我在這里遇到了一些錯誤,這對我來說毫無意義:
這是代碼:
<?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>
這是錯誤列表:
如您所見,工具欄在include標記中引用時明確存在,但是在使用應用程序名稱空間的兩個屬性中不可用。
有人知道發生了什么嗎?
資源名稱中不能包含大寫字母。 所以在這種情況下,我需要將Toolbar.axml更改為toolbar.axml
在xamarins票務系統中找到的資源https://bugzilla.xamarin.com/show_bug.cgi?id=36821
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.