【发布时间】:2017-07-26 23:48:09
【问题描述】:
我正在使用从 UIViewController 到 UINavigationController 的简单自定义 segue,该 UINavigationController 将 UICollectionViewController 作为它的根视图控制器。
转换按预期工作,但我首先看到一个黑屏,只有当转换结束时我才能看到 UICollectionViewController 内容。
故事板:
转场:
这是自定义转场的代码:
- (void)perform {
UIViewController *sourceViewController = self.sourceViewController;
UINavigationController *destinationViewController = self.destinationViewController;
[UIView animateWithDuration:0.25
delay:0.0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
destinationViewController.topViewController.view.transform =
CGAffineTransformMakeTranslation(0, 0);
sourceViewController.view.transform =
CGAffineTransformMakeTranslation(-sourceViewController.view.frame.size.width, 0);
}
completion:^(BOOL finished){
[destinationViewController.topViewController.view removeFromSuperview]; // remove from temp super view
[sourceViewController presentViewController:destinationViewController animated:NO completion:NULL]; // present VC
}];
}
注意:
当我运行一个简单的show segue 时,集合视图会正常加载,没有黑屏。
知道我在这里做错了什么吗?
【问题讨论】:
标签: ios objective-c iphone uiviewcontroller uinavigationcontroller