我刚刚尝试在 View Controller 之间进行自定义转换。它基本上将下一个旋转到 View 中,并且它起作用了。除了源 View Controller 在动画完成时短暂闪烁回到可见性之外,就像目标 View Controller 到达其最终位置一样。
我还收到了关于对开始/结束外观转换的不平衡调用
的警告,我仍在努力修复该警告 - 我不知道它们是否相关。
有没有人看到这里有任何东西跳出来,因为不太正确,会导致闪烁?
然后我只是分配了一个按钮来通过 Storyboard编辑器进行自定义转场。
-(void)perform
{
UIViewController *source = self.sourceViewController;
UIViewController *destination = self.destinationViewController;
[source.view addSubview:destination.view];
destination.view.transform = CGAffineTransformMakeRotation(M_PI / 2);
[UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationCurveEaseInOut animations:^{
destination.view.transform = CGAffineTransformMakeRotation(0);
}completion:^(BOOL finished){
[destination.view removeFromSuperview];
[source presentViewController:destination animated:NO completion:NULL];
}];
}
最佳答案
取出removeFromSuperview。
关于ios - 看到过渡中间闪烁吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27283430/