//屏幕宽度
#define kWIDTH [UIScreen mainScreen].bounds.size.width
//屏幕高度
#define kWIDTH [UIScreen mainScreen].bounds.size.width
//屏幕高度
#define kHEIGHT [UIScreen mainScreen].bounds.size.height
UIImageView * lunchImg=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
lunchImg.image=[UIImage imageNamed:@"lunch"];
[[UIApplication sharedApplication].keyWindow addSubview:lunchImg];
[UIView animateWithDuration:0.8 animations:^{
lunchImg.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1);
lunchImg.alpha=0.0;
} completion:^(BOOL finished) {
[lunchImg removeFromSuperview];
}];
本文介绍了一种使用Objective-C实现的全屏图片加载并带有缩放及淡出动画的方法。通过定义屏幕宽度和高度宏,创建UIImageView显示指定图片,并利用UIView动画完成从原始大小到放大1.5倍同时透明度渐变为0的效果。
1902

被折叠的 条评论
为什么被折叠?



