您的位置:首页 > 产品设计 > UI/UE

UIView 渐渐出现 和渐渐消失了动画效果

2016-07-12 17:36 766 查看
渐渐 出现

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

    }];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: