从阵列的成像图载入图片,并显示下一个或previous用鳍状肢 [英] load image from an array to an image view and show next or previous with flipper

查看:160
本文介绍了从阵列的成像图载入图片,并显示下一个或previous用鳍状肢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个静态数组。

private Integer[] mThumbIds = {
        R.drawable.sample_0, R.drawable.sample_1,
        R.drawable.sample_2, R.drawable.sample_3,
        R.drawable.sample_4, R.drawable.sample_5,
        R.drawable.sample_6, R.drawable.sample_7,
        R.drawable.sample_0
}

现在我有一个和鳍(或其他)显示了previous或下一张图片的帮助下,以显示图像视图中的一个这些图像。
第一个问题,如何在图像视图加载这些图像。
这将是对我好,如果你能提供一些示例code。
谢谢你。

Now I have to show these images in image view one by one and with the help of flipper(or anything else) show the previous or next image. First question how to load these images in image view. It would be good for me if you can provide some sample code. Thank you.

推荐答案

您可以使用数组像这样显示图像。

you can display image using array like this way.

int id= mThumbIds[5];

youImageView.setBackgroundDrawable(getResources().getDrawable(id))

这篇关于从阵列的成像图载入图片,并显示下一个或previous用鳍状肢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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