2013-04-30 23 views
5

Tôi đang cố gắng ràng buộc một hình ảnh web trong một listview trên Android, sử dụng Xamarin.Android và mvvmcross. Tôi nhận được lỗi này mặc dù.Lỗi MvvmCross MvxHttpImageView

MvxBind: Lỗi: 7.13 Xem Không tìm thấy loại - Mvx.MvxHttpImageView Android.Views.InflateException: Binary file XML dòng # 1: Lỗi khi gia tăng lớp Mvx.MvxHttpImageView

Đây là axml tôi ...

<?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> 

Trả lời

10

Nếu bạn đang sử dụng phiên bản 3, sau đó thử

  • MvxImageView thay vì MvxHttpImageView
  • ImageUrl thay vì HttpImageUrl

Quan điểm ràng buộc là trong https://github.com/slodge/MvvmCross/tree/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/Views

Tôi nghĩ MvxImageView cũng được thảo luận trong: http://slodge.blogspot.co.uk/2013/04/n2-lists-and-kittens-n1-days-of.html

Bạn cũng cần phải bao gồm File MvvmCross và Plugin DownloadCache, nếu không bạn sẽ gặp phải lỗi này

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

+1

cũng cú pháp json cũ bị tắt theo mặc định trong v3 - do đó cú pháp này sẽ không hoạt động cục bộ: MvxBind = "{'HttpImageUrl': {'Path': 'imageUrl'}}" – Stuart

Các vấn đề liên quan