简体   繁体   English

在Android展开式列表视图中加载图像

[英]Loading Images in Android Expandable List View

Currently I have implemented Expandable List View referencing from the following website: http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/ 目前,我已经从以下网站实现了可扩展列表视图的引用: http : //www.androidhive.info/2013/07/android-expandable-list-view-tutorial/

Now, how do I download a jpeg from a url(ee h--p://www.test.com/image.jpg) and display this image within each list child when that list child is chosen? 现在,我如何从网址(ee h--p://www.test.com/image.jpg)下载jpeg,并在选择该列表项时在每个列表项中显示此图像? Currently it only shows data. 当前它仅显示数据。

The reason is being, I don't want to download the images and store within the assets folder which will increase the size of the application, that's why use url to show only when that list child is chosen. 原因是,我不想下载图像并将其存储在资产文件夹中,这会增加应用程序的大小,这就是为什么使用url仅在选择该列表子项时显示的原因。

Is it possible? 可能吗? Or I could only do so by downloading the image beforehand and storing under assets? 或者我只能通过预先下载图像并存储在资产下来做到这一点?

Thanks In Advance 提前致谢

Yes it is possible. 对的,这是可能的。 If you want to implement this then you should grab a lazy loading library. 如果要实现此功能,则应获取一个惰性加载库。 For that you may use aquery just google it, its a nice library to provide the required mechanism. 对于您可以使用aquery它只是谷歌,它的一个很好的图书馆提供所需的机制。

Also Expandable istview is nothing but a listview so whatever you want to do inside a listview can be done within ExpandableListView as well. 另外,Expandable istview只是listview因此您可以在ExpandableListView完成listview中的所有操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM