【问题标题】:Error- No resource found that matches the given name (at 'MvxItemTemplate' with value '@layout/WorkViewItem')错误 - 未找到与给定名称匹配的资源(在“MvxItemTemplate”处,值为“@layout/WorkViewItem”)
【发布时间】:2014-11-25 19:46:05
【问题描述】:

我发布了这个问题,因为 IT 部门花了我 2 天的时间来解决这个问题。我认为其他人也可能会被它困住。所以这里有解决方案可以帮助其他人。

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')

【问题讨论】:

    标签: android xamarin xamarin.android mvvmcross


    【解决方案1】:

    这里的问题是

    @layout/WorkItemView
    

    应该是

    @layout/workitemview
    

    无论文件名如何,AKA 资源名称都必须全部小写

    【讨论】:

      猜你喜欢
      • 2016-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-28
      • 2018-08-16
      相关资源
      最近更新 更多