我有一个动画,当我按下连接的uibutton动画播放时,但是,第一次播放动画时它会在开始之前稍微延迟。
在视图控制器上,我将有五个动画需要此功能。
我也在使用故事板。
如何删除此延迟?
谢谢!
CODE: 米。
@implementation CMViewController
@synthesize blinkButton;
@synthesize eyesImage;
@synthesize playSound;
@synthesize showActivityView;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//setup animation
NSArray *eyeFrames = [NSArray array];
eyeFrames = [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"image1.png"],
[UIImage imageNamed:@"image2.png"],
[UIImage imageNamed:@"image3.png"],
[UIImage imageNamed:@"image4.png"],
[UIImage imageNamed:@"image5.png"],
nil];
eyesImage.animationImages = eyeFrames;
eyesImage.animationDuration = 3.0;
eyesImage.animationRepeatCount = 1;
[eyeFrames release];