首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MvxBind:错误:找不到视图类型- BindableListView

MvxBind:错误:找不到视图类型- BindableListView
EN

Stack Overflow用户
提问于 2015-05-06 20:23:57
回答 3查看 1.1K关注 0票数 0

我已经使用MvvmCross两年多了,但是这个最新的安卓问题被难住了。我显然遗漏了一些东西。

我已经使用最新版本升级了我的Xamarin和MonoDevelop。我一直在使用Mvx热金枪鱼3.5,并尝试升级到3.5.1,没有任何不同的结果。基本上,每个使用绑定的视图都会令人沮丧地失败,并在输出窗口中显示MvxBind:Error,视图变成空白。

我还通过尝试手动提供程序集和命名空间来更改setup类。我有急事要解决,斯图尔特,请指教。

代码语言:javascript
复制
MvxBind:Error:100,93 View type not found - md52d382d08e2b5b5a41f8bed5ba30f5cc4.BindableListView

这方面的一个例子是我的configuration视图中的绑定。

代码语言:javascript
复制
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/style_background">
    <Monovage.BindableListView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:cacheColorHint="#00000000"
        local:MvxBind="ItemsSource Thresholds"
        local:MvxItemTemplate="@layout/listitem_usagethreshold"
        android:layout_marginTop="0dp" />
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerHorizontal="true"
        android:orientation="vertical"
        android:background="@drawable/style_background">
        <ProgressBar
            android:layout_width="45dp"
            android:layout_height="45dp"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="false"
            android:layout_centerInParent="true"
            local:MvxBind="Visibility IsBusy, Converter=Visibility" />
    </RelativeLayout>
</LinearLayout>

可绑定列表视图是从MvxListView继承的列表视图

公共类BindableListView : MvxListView

EN

回答 3

Stack Overflow用户

发布于 2015-05-06 20:58:15

我昨天才用BindingFlowLayout处理了这个问题。我通过调整布局文件中的前缀解决了MvxBind:错误...

代码语言:javascript
复制
<BindingFlowLayout
            android:id="@+id/AllShowsFlow"
            android:orientation="horizontal"
            local:MvxItemTemplate="@layout/appmoviesgriditem"
            local:MvxBind="ItemsSource TVShows"
            android:minWidth="25px"
            android:minHeight="25px"
            android:layout_marginLeft="20dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

并添加组件设置。

代码语言:javascript
复制
protected override IList<Assembly> AndroidViewAssemblies
    {
        get 
        {
            var assemblies = base.AndroidViewAssemblies;
            assemblies.Add(typeof(MvxExtensions.BindingFlowLayout).Assembly);
            assemblies.Add(typeof(MvxExtensions.FlowLayout).Assembly);
            return assemblies;
        }
    }

基于Stuart在这里的回答:

MvxBind:Error: View type not found - mvvmemiextensions.EmiDatePicker

然而,这个错误在我的应用程序中是良性的,它从来没有造成任何问题。

票数 7
EN

Stack Overflow用户

发布于 2015-05-09 01:47:39

我也遇到了同样的问题,但是对于BindableExpandableListView,我得到了错误

代码语言:javascript
复制
[MvxBind] 237.25 View type not found - md58cb9ccb4af6afc62c0aa8757d7b275d0.BindableExpandableListView 

我在布局文件里有这个

代码语言:javascript
复制
<DeapExtensions.Binding.Droid.Views.BindableExpandableListView
        android:id="@+id/openExpandableListView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawSelectorOnTop="true"
        android:stackFromBottom="false"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginBottom="15dp"
        local:MvxBind="ItemsSource WrappedCategories"
        local:MvxItemTemplate="@layout/rowopentask"
        local:GroupItemTemplate="@layout/rowcategory" />

我只是删除了所有的前缀,如下所示

代码语言:javascript
复制
<BindableExpandableListView
        android:id="@+id/openExpandableListView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawSelectorOnTop="true"
        android:stackFromBottom="false"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginBottom="15dp"
        local:MvxBind="ItemsSource WrappedCategories"
        local:MvxItemTemplate="@layout/rowopentask"
        local:GroupItemTemplate="@layout/rowcategory" />

这似乎起到了作用。

票数 5
EN

Stack Overflow用户

发布于 2015-09-29 22:45:32

修复方法是MvvmCross不假设从C#到Java类型名称的1:1映射,可以使用以下代码片段从C#类型中获取底层Java类型名称:

代码语言:javascript
复制
string javaClassName = Java.Lang.Class.FromType(typeof(MyActivity));
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30076653

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档