How to set random images to ImageView#39;s?(如何将随机图像设置为 ImageView?)
问题描述
我正在使用 9 个图像视图,当我单击刷新按钮时,我想将图像随机设置为 imageview,但我尝试这样它适用于随机分配图像,但它在两个(或)三个 imageview 中重复相同的图像一次.我的代码中的问题在哪里..
i am using 9 image view's i want set images to imageview randomly , when I click on refresh button, but I tried like this it's working for random allocation of images but it's repeating the same image in two (or) three imageview's at a time. where is the problem in my code..
我不想重复,一个图像只用于一个图像视图..
i don't want repeat, one image for one imageview only..
推荐答案
使用 blessenm 的帖子,我写了一个你需要的类似代码.检查这是否对您有帮助.
using the post of blessenm ,i wrote a similar code that you need. check if this helps you.
这篇关于如何将随机图像设置为 ImageView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!