适用于iOS8以后
-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator{
[superviewWillTransitionToSize:size withTransitionCoordinator:coordinator];
[CATransactionbegin];
[CATransactionsetDisableActions:YES];
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
} completion:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
[CATransactioncommit];
}];
}
网友评论