Ant*_*nko 3 iphone sdk core-animation
基本上我有三个点应该在加载屏幕上连续变大和变小,我想知道做这样一个简单动画的最佳方法是什么 - 编码或其他?
对于简单动画,您可以使用UIImageView动画为一组图像设置动画(即将图像用作动画中的帧).
UIImageView* dotsImageView= [[UIImageView alloc] initWithFrame:dotsFrame];
// load all the frames of your animation
dotsImageView.animationImages = @[[UIImage imageNamed:@"image1.png"],
[UIImage imageNamed:@"image2.png"],
[UIImage imageNamed:@"image3.png"]];
// set how long it will take to go through all images
dotsImageView.animationDuration = 1.0;
// repeat the animation forever
dotsImageView.animationRepeatCount = 0;
// start the animation
[dotsImageView startAnimating];
// add it to the view
[self.view addSubview:dotsImageView];
Run Code Online (Sandbox Code Playgroud)
如果您不想使用预设图像作为点,可以使用完成块将UIView动画链接在一起.这是关于UIView动画的教程:http://www.raywenderlich.com/5478/uiview-animation-tutorial-practical-recipes