如何显示在android系统在画廊查看从网页图片 [英] How to display images from web in gallery view in android

查看:197
本文介绍了如何显示在android系统在画廊查看从网页图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我显示的图像与在绘制文件夹的图像库视图。
我的code

I displayed images to the gallery view with images in drawable folder. MyCode

public class GalleryView extends Activity {
Integer[] pics = {
  R.drawable.antartica1,
  R.drawable.antartica2,
  R.drawable.antartica3,
  R.drawable.antartica4,
  R.drawable.antartica5,
  R.drawable.antartica6,
  R.drawable.antartica7,
  R.drawable.antartica8,
  R.drawable.antartica9,
  R.drawable.antartica10
};
ImageView imageView;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Gallery ga = (Gallery)findViewById(R.id.Gallery01);
    ga.setAdapter(new ImageAdapter(this));

    imageView = (ImageView)findViewById(R.id.ImageView01);
    ga.setOnItemClickListener(new OnItemClickListener() {



public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
 long arg3) {
Toast.makeText(getBaseContext(), 
  "You have selected picture " + (arg2+1) + " of Antartica", 
  Toast.LENGTH_SHORT).show();
imageView.setImageResource(pics[arg2]);

}

    });

}



}

不过,我有这样一个ArrayList图像

But I have images in an arraylist like this

[http://sport24x7.com/nightclub/photos/ 9955917512-Gym-ChestWorkout_xxlarge.jpg, http://sport24x7.com/nightclub/photos/ 64557264beginner_gym_workout_legs_large.jpg, http://sport24x7.com/nightclub/photos/ 54809160intro-ez-bar.jpg]

如何显示图库查看这些图像。谁能帮我做到这一点?

How to show these images in gallery view. Can anyone help me to do this?

推荐答案

你应该下载图像,然后与画廊显示它们。

我建议你​​使用 UIL

you should download images and then display them with Gallery.
i recommend you to use UIL

这篇关于如何显示在android系统在画廊查看从网页图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆