Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.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 iPad模态视图';在主窗口中选择s rect_Ios_Objective C_Uikit - Fatal编程技术网

Ios iPad模态视图';在主窗口中选择s rect

Ios iPad模态视图';在主窗口中选择s rect,ios,objective-c,uikit,Ios,Objective C,Uikit,我在UISplitViewController的顶部显示一个模态视图(带有UIModalPresentationFormSheet)。我想得到模态视图相对于UISplitViewController(基本上是整个窗口)将采用的确切rect。i、 e.模态视图位于x、y坐标和尺寸。 我怎么找到这个?我查看了UIView的“convertRect:fromView:”方法,但无法确定哪种组合会起作用 谢谢。[splitView convertRect:modallyPresentedVC.view.

我在UISplitViewController的顶部显示一个模态视图(带有UIModalPresentationFormSheet)。我想得到模态视图相对于UISplitViewController(基本上是整个窗口)将采用的确切rect。i、 e.模态视图位于x、y坐标和尺寸。 我怎么找到这个?我查看了UIView的“convertRect:fromView:”方法,但无法确定哪种组合会起作用


谢谢。

[splitView convertRect:modallyPresentedVC.view.bounds fromView:modallyPresentedVC.view]
应该可以做到这一点。确保在演示文稿的完成块中调用它(在所有动画完成之后)。

谢谢,但它似乎会给出一些奇怪的结果。我尝试了以下操作:[self-presentViewController:navController动画:是的完成:^{CGRect clippedRect=[split.view convertRect:childController.view.bounds toView:childController.view];}];但是它给出了一些奇怪的坐标:{-242,-128},{540,576}}为了让它正常工作,你需要这样呈现:
[split presentViewController:navController animated:YES completion:…]
。否则,没有superview链,您将得到错误的结果。你仍然可以计算它,但它会更复杂。