如何获取数组中的当前图像索引号? [英] how to get current image index number in array?

查看:194
本文介绍了如何获取数组中的当前图像索引号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,





我有一个图像阵列

mImagesArray = new int [] { R.drawable.image_1,R.drawable.image_2,R.drawable.image_3,R.drawable.image_4,R.drawable.image_5,R.drawable.image_6,R.drawable.image_7,R.drawable.image_8,R。 drawable.image_9,R.drawable.image_10}



i每10秒1by1调用此图像当用户触摸表面视图时我想知道图像数组中的哪个元素索引没有怎么可能?

Hi All,


I have a image array
mImagesArray = new int[] {R.drawable.image_1,R.drawable.image_2,R.drawable.image_3,R.drawable.image_4,R.drawable.image_5,R.drawable.image_6,R.drawable.image_7,R.drawable.image_8,R.drawable.image_9,R.drawable.image_10}

i have call this images every 10sec 1by1 when user touch on surface view i want to know which element in image array index no how it is possible?

推荐答案

我假设您只是通过计时器逐个显示图像。但是如果你不记得当前的那个,你就无法完成这个任务,而你是通过索引来完成的,否则你每次都无法计算下一个。因此,结论是:您已经拥有此索引,并且您在显示此索引所需的相同上下文中具有此索引。这样,你不应该有任何问题;他的问题毫无意义。



我唯一猜到的是你实际上没有开发显示图像的代码,但是你的问题就是误解了提问时你的问题。



-SA
I assume you are just showing an image one by one by a timer. But you cannot accomplish this task if your don't remember the "current" one, and you do it by index, otherwise you would not be able to calculate the "next" each time. So, the conclusion is: you already have this index, and you have this in the same context you need for showing this index. This way, you shouldn't have any problem; and he question makes no sense.

The only guess I can make is that you did not actually develop the code for showing images, but then your problem would be misrepresentation of your problem when asking a question.

—SA


这篇关于如何获取数组中的当前图像索引号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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