【发布时间】:2019-05-02 06:04:48
【问题描述】:
从 Fresco SimpleDraweeView 获取图像 URL。
我有带有 EditText 和 SimpleDraweeView 的 recyclerView 项目,在我的活动按钮上也有。单击按钮时,我想将整个 recyclerview 项目数据放入 ArrayList。
这是在按钮单击时编写的代码,我成功获得了除 SimpleDraweeView URL 之外的 editText 数据。
ArrayList<ContactUs> getContactUsArrayList = new ArrayList<>();
for (int i = 0; i < getContactUsArrayList.size(); i++) {
View view = rvContact.getChildAt(i);
EditText etName = (EditText) view.findViewById(R.id.etName);
EditText etMobile = (EditText) view.findViewById(R.id.etMobile);
SimpleDraweeView sdvImage = (SimpleDraweeView) view.findViewById(R.id.sdvImage);
String strName = etName.getText().toString();
String strNumber = etMobile.getText().toString();
String strImgUrl = ""; //what is the property?
}
从 SimpleDraweeView 获取 URL 的属性是什么?
【问题讨论】:
-
你是如何在 recyclerview 中推送数据的?
-
从 API 加载数据并将数据推送到适配器,然后我尝试从活动中单击按钮获取整个项目数据
-
您可以从 API 中保存 url,并在 for 循环中使用相同的索引号。目前,SimpleDraweeView 不支持直接 url。
-
好吧,这意味着,根据位置获取特定项目数据,如果我错了,请纠正我。
-
是的。将网址保存在另一个列表中并稍后使用
标签: android url fresco imageurl