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

    }];



你可能感兴趣的:(UI)