(I have six image view and I want to animate the image randomly for two seconds among them.)
Hello Friends ,
I have six image view with different static images in one view and I want them to animate with the help of
img1.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:imgName],
[UIImage imageNamed:imgName2],
[UIImage imageNamed:imgName],
[UIImage imageNamed:imgName2],
[UIImage imageNamed:imgName],
[UIImage imageNamed:imgName2],
method and I want to select the imageview randomly for two seconds.
What is the best way to do this?
Well to pick a random number from 0,1,2,3,4,5, just do this
To “display for two seconds” you need to learn about NSTimer. It is quite simple. Here is a simple define that will do something in a period of time:
So for example:
in each case you would have to write the routine “eliminateImage” or “fadeToBlack”.