The example app below demonstrates the use of the following controls. You can use the slider, step control, and button to control playing an animation in the Image view.
- Uiimageview)
- Slider (uislider)
- Step control (uistpper)
Shows the running effect of the sample app:
Animation effect in Image viewCode:
-(Ibaction) toggleanimation :( ID) sender {
If (bunnyview1.isanimating ){
[Self. bunnyview1 stopanimating];
[Self. bunnyview2 stopanimating];
[Self. bunnyview3 stopanimating];
[Self. bunnyview4 stopanimating];
[Self. bunnyview5 stopanimating];
[Self. togglebutton settitle: @ "Skip! "Forstate: uicontrolstatenormal];
}
Else {
[Self. bunnyview1 startanimating];
[Self. bunnyview2 startanimating];
[Self. bunnyview3 startanimating];
[Self. bunnyview4 startanimating];
[Self. bunnyview5 startanimating];
[Self. togglebutton settitle: @ "stop" forstate: uicontrolstatenormal];
}
}
Download the source code of the iOS 5-app project.
Original article link