首页 > 代码库 > self.view添加UIView时添加动画

self.view添加UIView时添加动画

    CATransition *animation = [CATransition animation];    animation.delegate = self;    animation.duration = 0.5f;    animation.timingFunction = UIViewAnimationCurveEaseInOut;        if ([subView isKindOfClass:[AreaNumPickerView class]]) {        animation.subtype = kCATransitionFromBottom;    }else{        animation.type    = kCATransitionPush;     //平移        animation.subtype = kCATransitionFromRight;//从右到左    }        [superView addSubview:subView];    [[superView layer] addAnimation:animation forKey:@"animation"];