This repository has been archived by the owner on Oct 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 496
app:imageUrl="@{imageUrl}能运行起来吗? #3
Comments
|
报错如下:annot find the setter for attribute 'imageUrl' on android.widget.ImageView with parameter type java.lang.String. |
几个checkpoint
|
环境我都配置好了,就这个东西编译不过。我对这种写法也觉得特别奇怪,app:imageUrl="@{url}"这样写法不是会去找ImageView属性吗?而且就对一个静态方法添加注解,这样是不是太莫名其妙了?楼主你能运行出来并加载图片么? |
代码运行没问题,你是跑的我的代码吗 |
to @pengwei1024 |
@BindingAdapter({"imageUrl", "error"})
public static void loadImage(ImageView view, String url, Drawable error) {
Log.d(App.TAG, "load image");
Picasso.with(view.getContext()).load(url).error(error).into(view);
} 楼主 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
@BindingAdapter({"bind:imageUrl", "bind:error"})
public static void loadImage(ImageView view, String url, Drawable error) {
Picasso.with(view.getContext()).load(url).error(error).into(view);
}
我这样写提示TextView没有imageUrl方法报错。
The text was updated successfully, but these errors were encountered: