Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIPresentationController在显示之后才调用ContainerViewillLayoutSubView_Ios_Uipresentationcontroller - Fatal编程技术网

Ios UIPresentationController在显示之后才调用ContainerViewillLayoutSubView

Ios UIPresentationController在显示之后才调用ContainerViewillLayoutSubView,ios,uipresentationcontroller,Ios,Uipresentationcontroller,我有一个UIPresentationController在主视图上显示一个侧菜单,固定宽度为300。然后,用户可以从侧菜单打开全屏模式视图。当模式视图被取消时,菜单视图在取消动画期间填充屏幕(这是错误的)。在动画结束时,将调用containerViewWillLayoutSubviews,菜单将其宽度更正为300 我确实实现了PresentedViewContainerView的框架。我还实现了shouldPresentInFullscreen在菜单视图上返回NO(尽管这似乎不会影响我真正能确定

我有一个
UIPresentationController
在主视图上显示一个侧菜单,固定宽度为300。然后,用户可以从侧菜单打开全屏模式视图。当模式视图被取消时,菜单视图在取消动画期间填充屏幕(这是错误的)。在动画结束时,将调用
containerViewWillLayoutSubviews
,菜单将其宽度更正为300

我确实实现了PresentedViewContainerView的框架。我还实现了
shouldPresentInFullscreen
在菜单视图上返回NO(尽管这似乎不会影响我真正能确定的任何内容)


为什么在解除动画之前不调用
containerViewWillLayoutSubviews
?当菜单视图被覆盖和显示时,我应该如何保持其宽度?

感谢riadhluke指导我

我的解决方案在我的菜单的
prepareforsgue

UIViewController *destination = [segue destinationViewController];
if (destination.modalPresentationStyle == UIModalPresentationFullScreen) {
    destination.modalPresentationStyle = UIModalPresentationOverFullScreen;
}

这将强制全屏模态演示在全屏上,这将导致菜单不会丢失,因此不会重新布置解雇后的动画。

我认为这个问题会有所帮助,谢谢,这确实有帮助!