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

下面的范例App演示了以下控件的使用,经过滑块、步进控件和按钮来控制在图像视图中播放动画。ide

  • 图像视图(UIImageView)动画

  • 滑块(UISlider)spa

  • 步进控件(UIStpper).net

范例App的运行效果,以下图所示:code

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

- (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];
}
}
get

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

相关文章
相关标签/搜索