您的位置:首页 > 移动开发 > IOS开发

iOS 5 编程(1)-图像视图、滑块和步进控件的使用(源码下载)

2012-09-13 08:54 447 查看
下面的范例App演示了如下控件的使用,通过滑块、步进控件和按钮来控制在图像视图中播放动画。

图像视图(UIImageView)
滑块(UISlider)
步进控件(UIStpper)
范例App的运行效果,如下图所示:



在图像视图中实现动画效果的部分代码:

- (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:@"跳跃吧!" forState:UIControlStateNormal];
}
else{
[self.bunnyView1 startAnimating];
[self.bunnyView2 startAnimating];
[self.bunnyView3 startAnimating];
[self.bunnyView4 startAnimating];
[self.bunnyView5 startAnimating];
[self.toggleButton setTitle:@"停 止" forState:UIControlStateNormal];
}
}


下载该iOS 5 – App 项目源代码

原文链接
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐