使用设备上的图像填充 listView
好吧,我花了两天时间寻找一个很好的简单示例,说明如何使用设备上的图像来填充列表视图,我得出的结论是,没有简单的方法可以做到这一点。我知道,每次我将别人示例中的点点滴滴放在一起时,通常都会得到很多我不需要的额外代码。有人可以告诉我如何简单地将图像从设备加载到列表视图吗?这里没有任何书籍、教程或帖子只是简单地展示如何做到这一点,而且它既有趣又疯狂。
Ok so Ive spent the last two days looking for a good simple example of how to use the images on a device to populate a list view and Ive come to the conclusion that there is no easy way to do this. I know that everytime I put together bits and pieces from some one elses examples that I usually end up with lots of extra code i dont need. Can some one please show me how to simply load images from the device to a list view. There is no book, tutorial, or post on here that just simply shows how to do this and its kind of funny and crazy at the same time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是其余的代码,使用上面链接的 SDImageLoader: http://www.samcoles.co.uk/mobile/android-asynchronously-load-image-from-sd-card
ListAdapter 类:
在实际的 ListActivity 中,在 onCreate() 中设置列表适配器:
在我的示例中,通过应用程序添加图像时,图像的绝对文件路径存储在数据库中。
Here's the rest of the code, using the SDImageLoader linked to above from here: http://www.samcoles.co.uk/mobile/android-asynchronously-load-image-from-sd-card
The ListAdapter class:
In the actual ListActivity, in your onCreate() set the list adapter:
In my example the absolute filepaths for the images are stored in the database when added via the app.