我需要添加的ImageView或web视图在我的列表视图 [英] I need to add a imageview or webview in my listview
问题描述
我有一个问题。我得到了一些code,我不打算在这里全部投入,因为它是为大。但我有一个列表视图。我也这样说:
I got a problem. I got some code which I'm not going to put all here because it's to big. But I got a listview. And i do it like this:
lv = (ListView) findViewById(R.id.list);
(Here is normally some asynctask code and stuff)
// list adapter
ListAdapter adapter = new SimpleAdapter(MainActivity.this, placesListItems,
R.layout.list_item, new String[] { KEY_REFERENCE, KEY_NAME, KEY_VICINITY, KEY_DISTANCE,
KEY_LOCATION}, new int[] { R.id.reference, R.id.name, R.id.vicinity, R.id.radius, R.id.location});
// Adding data into listview
lv.setAdapter(adapter);
现在的事情是我得到了一个网址,并在网站上的唯一的事情就是一个图像。这是一个从谷歌广场的照片。现在,我想在我的列表视图图像。因此,在每一个项目还有另外一个形象。
Now the thing is I got an url and the only thing on the site is an image. It's from Google Place Photos. Now I want an image in my listview. So in every item there is another image.
我可以用的ImageView或网页视图做到这一点。
I can do it with an imageview or with a webview.
因此,让我们对赛格URL存储在这样的:
So let's sey the url is stored in this:
KEY_URL;
而ImageView的或网页流量是这样的:
And the imageview or webview is this:
R.id.image;
我怎样才能做到这一点?
How can I do this?
在此先感谢!
推荐答案
您可以用[androidQuery]的的https://$c$c.google.com/p/android-query/
它有一个线程池。它加载图像以不同的方式。有选择向下采样图像以节省内存。由谷歌做:)
You Can use [androidQuery]https://code.google.com/p/android-query/ It has a thread pool. It load images in different ways. Has the option to down sample images to save memory. Made by google :)
这篇关于我需要添加的ImageView或web视图在我的列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!