iOS常用动画代码

    //iOS常用动画代码
    
    
    
    UIImageView* bolingbolingImageView = [[UIImageView alloc]init];
    [self.view addSubview:bolingbolingImageView];
    //设置动画的frame
    bolingbolingImageView.frame = CGRectMake(0, 0, 30, 30);
    
    //动画各帧图片
    bolingbolingImageView.animationImages = [NSArray arrayWithObjects:
                                             [UIImage imageNamed:@"bolingboling1.png"],
                                             [UIImage imageNamed:@"bolingboling2.png"],
                                             [UIImage imageNamed:@"bolingboling3.png"],
                                             [UIImage imageNamed:@"bolingboling4.png"],
                                             [UIImage imageNamed:@"bolingboling5.png"],nil];
    //动画持续时间
    [bolingbolingImageView setAnimationDuration:0.6f]; 
    //动画重复次数
    [bolingbolingImageView setAnimationRepeatCount:1];
    //开始动画
    [bolingbolingImageView startAnimating];


你可能感兴趣的:(iOS常用动画代码)