初学object-c,纪录点点滴滴......
在viewController的viewDidLoad中,加入一下代码,在工程目录下存在1.png和2.png图片
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
UIImageView *imgView = [[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.view addSubview: imgView];
imgView.animationImages=[NSArray arrayWithObjects:
[UIImage imageNamed:@“1.png”],
[UIImage imageNamed:@“2.png"],nil ];//1.png; 2.png
imgView.animationDuration
= 1;
//duration : 1s
imgView.animationRepeatCount = 0;
//repeat always
[imgView startAnimating];
//start
}
最后
以上就是缥缈牛排最近收集整理的关于object-c---图片动画的全部内容,更多相关object-c---图片动画内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复