找不到 Mvvmcross MvxListview MvxItemTemplate 资源
Mvvmcross MvxListview MvxItemTemplate resource not found
我正在使用 Mvvmcross 在 Xamarin 中构建一个 Android 应用程序。在这个应用程序中,我需要 F.a.q。页面,为此我需要一个列表视图。使用 MvxListView 我成功地显示了没有模板的项目。奇怪的是当我绑定 MvxItemTemplate 时它没有编译给我错误。
No resource found that matches the given name (at 'MvxItemTemplate' with value '@layout/FaqCategoryLayout'. (APT0000)
绑定如下所示:
<LinearLayout
android:orientation="vertical"
android:id="@+id/Page"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@android:color/white">
<Mvx.MvxListView
android:layout_width="match_parent"
android:layout_height="match_parent"
local:MvxItemTemplate="@layout/FaqCategoryLayout"
local:MvxBind="ItemsSource Collection"
/>
</LinearLayout>
这是布局
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
local:MvxBind="Text Category"/>
</LinearLayout>
我看到了很多关于这个主题的帖子,其中大部分很容易修复。但是 none 对我有用。我非常确定布局名称完全相同。此外,当我在按钮背景上使用相同的布局时,它确实会按应有的方式编译。
没关系。我是个白痴。我在列表视图中重新观看了来自 mvvmcross n+1 的视频,注意到一个基本关键字:"Lowercase".
所以将 ItemTemplate 设置为小写确实起到了作用
local:MvxItemTemplate="@layout/faqcategorylayout"
我正在使用 Mvvmcross 在 Xamarin 中构建一个 Android 应用程序。在这个应用程序中,我需要 F.a.q。页面,为此我需要一个列表视图。使用 MvxListView 我成功地显示了没有模板的项目。奇怪的是当我绑定 MvxItemTemplate 时它没有编译给我错误。
No resource found that matches the given name (at 'MvxItemTemplate' with value '@layout/FaqCategoryLayout'. (APT0000)
绑定如下所示:
<LinearLayout
android:orientation="vertical"
android:id="@+id/Page"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@android:color/white">
<Mvx.MvxListView
android:layout_width="match_parent"
android:layout_height="match_parent"
local:MvxItemTemplate="@layout/FaqCategoryLayout"
local:MvxBind="ItemsSource Collection"
/>
</LinearLayout>
这是布局
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
local:MvxBind="Text Category"/>
</LinearLayout>
我看到了很多关于这个主题的帖子,其中大部分很容易修复。但是 none 对我有用。我非常确定布局名称完全相同。此外,当我在按钮背景上使用相同的布局时,它确实会按应有的方式编译。
没关系。我是个白痴。我在列表视图中重新观看了来自 mvvmcross n+1 的视频,注意到一个基本关键字:"Lowercase".
所以将 ItemTemplate 设置为小写确实起到了作用
local:MvxItemTemplate="@layout/faqcategorylayout"