我遇到了MvxImageView的问题,因为它在ListView的行中显示错误的图像。前两行显示正确的图片,但之后的每一行都使用第一行或第二行的图像,如下所示:
我有以下axml文件:
view.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-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/eco_color_4"
android:orientation="vertical"
android:padding="15dp">
<TextView
local:MvxBind="Text Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/textView"
style="@style/PageHeader.Text" />
</LinearLayout>
<View
android:id="@+id/divider"
android:background="@drawable/black_white_gradiant"
android:layout_width="match_parent"
android:layout_height="10sp" />
<MvxListView
local:MvxBind="ItemsSource Regions; ItemClick RegionSelectedCommand"
local:MvxItemTemplate="@layout/region_list_item"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_marginTop="20dp"
android:id="@+id/listView" />
</LinearLayout>
region_list_item.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-auto"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Mvx.MvxImageView
local:MvxBind="ImageUrl LargeImageUrl"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:id="@+id/trail_icon"
android:layout_gravity="center_vertical"
android:scaleType="fitCenter" />
<econb.android.controls.TextViewWithFont
local:MvxBind="Text Name"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:singleLine="false"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_gravity="center_vertical"
local:customFont="font.ttf" />
</LinearLayout>
RegionResult.cs:
public class RegionResult
{
public long Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string LargeImageUrl { get; set; }
public string Data { get; set; }
}
LargeImageUrl设置为完全限定的url。任何人都可以了解正在发生的事情吗?