嗨我试图用数据绑定更新imageview,但我分得到如何做到这一点。数据绑定android更新imageview
我VAR
@BindingAdapter({"bind:someImage"})
public void loadIt(ImageView view, String imageUrl) {
Picasso.with(view.getContext())
.load(getSomeImage())
.placeholder(android.R.drawable.alert_dark_frame)
.into(view);
}
public void setSomeImage(){
notifyPropertyChanged(BR.someImage);
}
我的布局
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imagePath"
app:imageUrl="@{var.someImage}"/>
我有搜索,但无法找到解决办法.... 链接= link1,Link2,您使用的Link 3