当一个view被添加到父控件中,就会调用

来源:互联网 发布:淘宝新手开店怎么装修 编辑:程序博客网 时间:2024/06/05 05:44
/** *  当一个view被添加到父控件中,就会调用 */- (void)didMoveToSuperview{//    self.alpha = 0;//    //    [UIView animateWithDuration:2 animations:^{//        self.alpha = 1;//    }];    CAKeyframeAnimation *anim = [CAKeyframeAnimation animation];    anim.keyPath = @"transform.scale";    anim.values = @[@0, @1.5, @1, @1.5, @1];    anim.duration = 0.5;    [self.layer addAnimation:anim forKey:nil];}//- (void)removeFromSuperview//{//    [UIView animateWithDuration:2 animations:^{//        self.alpha = 0;//    } completion:^(BOOL finished) {//        [super removeFromSuperview];//    }];//}

0 0
原创粉丝点击