动画冲突2

还有一种最常见的动画冲突就是自定义动画与系统动画的冲突。

UINavigationController类带有动画的页面切换动作:

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated; 
- (UIViewController *)popViewControllerAnimated:(BOOL)animated; 

UIViewController类带有动画的页面切换动作:

- (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion NS_AVAILABLE_IOS(5_0);
- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^)(void))completion NS_AVAILABLE_IOS(5_0);

正常情况下我们视图上的自定义动画应该尽可能避开以上系统动画,系统动画执行时页面刷新或重新布局都不要附带动画。

Written on September 2, 2015