/**
* 当一个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];
// }];
//}
当一个view被添加到父控件中,就会调用
最新推荐文章于 2019-06-22 14:46:53 发布