呈现模态视图控制器而不覆盖iPhone上的当前视图

Maz*_*ser 9 iphone uiviewcontroller ios childviewcontroller ios7

在此输入图像描述

我一直在尝试添加视图容器,从侧面留出20px的空间.但似乎不是这样做的正确方法......

// ADD CHILD VIEW CONTROLLER
    [parentViewController addChildViewController:childViewController];
    [parentViewController.view addSubview:childViewController.view];
    [childViewController didMoveToParentViewController:parentViewController];

// REMOVE THE CHILD VIEW CONTROLLER
    [childViewController willMoveToParentViewController:nil];
    [childViewController view] removeFromSuperview];
    [childViewController removeFromParentViewController];
Run Code Online (Sandbox Code Playgroud)

更新 我已经通过使用这个MZFormSheetController" https://github.com/m1entus/MZFormSheetController "表单演示与酷视图转换找到了它.

Maz*_*ser 6

使用MZFormSheetController " https://github.com/m1entus/MZFormSheetController "表单演示与冷视图转换.或者,iOS 8及以上版本,你可以使用viewController.modalPresentationStyle = UIModalPresentationOverCurrentContext; 祝你好运,如果你想要一个完整的片段,请告诉我...