MvvmCross MvxHttpImageView错误

问题描述:

我想在Android上使用Xamarin.Android和mvvmcross在列表视图中绑定Web图像。虽然我收到了这个错误。MvvmCross MvxHttpImageView错误

MvxBind:错误:7.13视图类型未发现 - Mvx.MvxHttpImageView Android.Views.InflateException:二进制XML文件行#1:错误充气类Mvx.MvxHttpImageView

这是我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/com.mynamespace.android" 
    android:orientation="horizontal" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

<LinearLayout 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 

    <Mvx.MvxHttpImageView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:id="@+id/iconeView" 
        local:MvxBind="{'HttpImageUrl':{'Path':'imageUrl'}}" /> 
    <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:textSize="30dp" 
      local:MvxBind="Text name" /> 
    <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:textSize="10dp" 
      local:MvxBind="Text tagline" /> 
</LinearLayout> 

如果使用的是V3,然后尝试

  • MvxImageView代替MvxHttpImageView
  • ImageUrl,而不是HttpImageUrl

https://github.com/slodge/MvvmCross/tree/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/Views

我觉得MvxImageView中还讨论了束缚的观点:http://slodge.blogspot.co.uk/2013/04/n2-lists-and-kittens-n1-days-of.html

您还需要包括MvvmCross文件和DownloadCache插件,否则你会得到这个错误

"No IMvxImageHelper registered - you must provide an image helper before you can use a MvxImageView"

+1

旧的json语法在默认情况下在v3中是禁用的 - 所以这个语法在本地不起作用:MvxBind =“{'HttpImageUrl':{'Path':'imageUrl'}}” – Stuart 2013-04-30 05:11:34