Xamarin.android 如何动态地将多个绑定到ImageView
我想将以下内容交叉绑定到ImageView属性: 1) 单击Xamarin.android 如何动态地将多个绑定到ImageView,xamarin.android,mvvmcross,Xamarin.android,Mvvmcross,我想将以下内容交叉绑定到ImageView属性: 1) 单击 2) ImageUrl-更改图像 3) 已启用 in Layout file: <ImageView android:id="@+id/imgTest" android:src="@drawable/Img_Test" android:layout_width="wrap_content" android:layout_height="wrap_content" andro
2) ImageUrl-更改图像
3) 已启用
in Layout file:
<ImageView
android:id="@+id/imgTest"
android:src="@drawable/Img_Test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxHeight="80dp"
android:maxWidth="80dp"
android:layout_margin="20dp"
android:scaleType="fitCenter"
local:MvxBind =" " /
布局文件中的:
您需要使用MvxImageView
才能绑定到ImageUrl
因此,将AXML布局更改为:
<Mvx.MvxImageView
android:id="@+id/imgTest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxHeight="80dp"
android:maxWidth="80dp"
android:layout_margin="20dp"
android:scaleType="fitCenter"
local:MvxBind="Click Commands[DisplayCase]; Enabled AuthCommand('View_user'); ImageUrl MyTargetImage(false)" />
我不知道您试图绑定到Enabled
属性的是什么,但它看起来不正确。我遵循了您的方法。它不起作用。我将此组合用于图像路径:1)分辨率:ImgTest_Normal/ImgTest_Grey 2)资源/可绘制/ImgTest_Normal或ImgTest_Grey在转换器中。没有错误,也不起作用。如何在转换器中返回DrawableId?
<Mvx.MvxImageView
android:id="@+id/imgTest"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxHeight="80dp"
android:maxWidth="80dp"
android:layout_margin="20dp"
android:scaleType="fitCenter"
local:MvxBind="Click Commands[DisplayCase]; Enabled AuthCommand('View_user'); ImageUrl MyTargetImage(false)" />