我正在从导航控制器弹出一个视图控制器。当我弹出控制器时,我想给它动画像推动一个视图控制器。为此目的我使用下面的代码
CATransition* transition = [CATransition animation];
transition.duration = 0.3f;
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[self.navigationController.view.layer addAnimation:transition
forKey:kCATransition];
[self.appDelegate setUpForLVC];
[self.navigationController popViewControllerAnimated:NO];
当动画开始时,我会在这里获得黑色效果。请告诉我我的代码有什么问题?
答案 0 :(得分:2)
在didFinishLaunchingWithOptions
中添加此代码self.window.backgroundColor = [UIColor whiteColor];
self.window.tintColor = [UIColor whiteColor];
**OR**
2)Set animation duration to 0