Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.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 Modalview控制器框架移动_Ios_View_Modalviewcontroller - Fatal编程技术网

Ios Modalview控制器框架移动

Ios Modalview控制器框架移动,ios,view,modalviewcontroller,Ios,View,Modalviewcontroller,我不确定我是否能用这种方式做到这一点,但让我们先和比我聪明的人一起尝试一下 我希望能够通过拖动来移动显示的控制器的框架。我希望看到我调用了[self-presentModalViewController:anotherVC animated:YES]的控制器;下面是演示的一个。我看到白色的背景 为了在不显示模态视图控制器的情况下实现此功能,我可以添加子视图,即: [self.view addSubview:anotherVC.view]; 但是,是否有方法移动模态显示视图控制器,并能够看到该模

我不确定我是否能用这种方式做到这一点,但让我们先和比我聪明的人一起尝试一下

我希望能够通过拖动来移动显示的控制器的框架。我希望看到我调用了[self-presentModalViewController:anotherVC animated:YES]的控制器;下面是演示的一个。我看到白色的背景

为了在不显示模态视图控制器的情况下实现此功能,我可以添加子视图,即:

[self.view addSubview:anotherVC.view];

但是,是否有方法移动模态显示视图控制器,并能够看到该模态控制器在其中显示的视图?

如果需要在模态视图后面显示父视图,则可以使用以下代码:

另一个vc.view.frame设置为小于父视图

anotherVC.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:anotherVC animated:YES]; 
但父视图的可见部分将变暗以防止交互

UIModalPresentationFormSheet

The width and height of the presented view are smaller than those of the screen and the view is centered onscreen. If the device is in a
横向和键盘是可见的,键盘的位置 视图向上调整,使视图保持可见。全部暴露 区域变暗以防止用户与它们交互


我不确定这是否有效。我试着改变原点,我得到的只是白色背景。我解决这个问题的方法是制作父视图控制器的屏幕截图,并将其用作我的模态视图控制器(当然是UIIMageView)的背景。