错误-没有找到与给定名称匹配的资源(在“MvxItemTemplate”上,值为“@ layout / WorkViewItem”)

3

我发起这个问题是因为IT花了我两天时间才解决了这个问题。我认为其他人也可能会遇到同样的困境,所以在这里提供解决方案可能对其他人有帮助。

WorkItemSelectionView.axml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res/Lloyd.Droid"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dp">
    <TextView
        android:text="Tasks:"
        android:layout_width="fill_parent"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_height="wrap_content"
        android:textStyle="bold" />
    <Mvx.MvxListView
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        local:MvxBind="ItemsSource WorkItems; ItemClick SelectionCommand"
        local:MvxItemTemplate="@layout/WorkItemView" />
</LinearLayout>

WorkItemView.axml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res/CCHQ.Droid"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textSize="30dp"
        local:MvxBind="Text Name" />
</LinearLayout>

无法编译,出现错误信息:
No resource found that matches the given name (at 'MvxItemTemplate' with value '@layout/WorkViewItem')
1个回答

12

这里的问题与

@layout/WorkItemView

它需要被完成。

@layout/workitemview

无论文件名如何,AKA资源名称都需要全部小写。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接