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];

    }];



已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页