UIView 渐渐出现 和渐渐消失了动画效果
Posted TF_guo
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了UIView 渐渐出现 和渐渐消失了动画效果相关的知识,希望对你有一定的参考价值。
渐渐 出现
self.photoView = [[PhotoShowView alloc]initWithFrame:PJ_MainScreen];
self.photoView.transform = CGAffineTransformMakeScale(0.1, 0.1);
self.photoView.alpha = 0;
self.photoView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.photoView];
[UIView animateWithDuration:2 animations:^
self.photoView.transform = CGAffineTransformMakeScale(1, 1);
self.photoView.alpha = 1;
completion:^(BOOL finished)
];
渐渐消失
self.transform = CGAffineTransformMakeScale(1, 1);
self.alpha = 1;
[UIView animateWithDuration:2 animations:^
self.transform = CGAffineTransformMakeScale(0.1, 0.1);
self.alpha = 0;
completion:^(BOOL finished)
[self removeFromSuperview];
];
以上是关于UIView 渐渐出现 和渐渐消失了动画效果的主要内容,如果未能解决你的问题,请参考以下文章