2013-04-30 15 views
5

Próbuję powiązać obraz sieciowy w widoku list na Androida, używając Xamarin.Android i mvvmcross. Dostaję ten błąd.Błąd MvvmCross MvxHttpImageView

MvxBind: Błąd: 7,13 typ widoku nie znaleziono - Mvx.MvxHttpImageView Android.Views.InflateException: Binary plik XML linia nr 1: Błąd pompowania klasa Mvx.MvxHttpImageView

To mój 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> 

Odpowiedz

10

Jeśli używasz v3, a następnie spróbuj

  • MvxImageView zamiast MvxHttpImageView
  • ImageUrl zamiast HttpImageUrl

Związane poglądy są w https://github.com/slodge/MvvmCross/tree/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/Views

myślę MvxImageView omawiany jest także w: http://slodge.blogspot.co.uk/2013/04/n2-lists-and-kittens-n1-days-of.html

Należy również dołączyć plik MvvmCross i Pobierz wtyczki do pamięci podręcznej, inaczej otrzymasz ten błąd:

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

+1

również stara składnia json jest domyślnie wyłączona w wersji 3 - więc ta składnia nie będzie działać lokalnie: MvxBind = "{'HttpImageUrl': {'Path': 'imageUrl'}}" – Stuart

Powiązane problemy