我有VC,我想推动它并看到它下面的VC.
如果我以模态方式呈现我可以做到(Display clearColor UIViewController over UIViewController)
解决方法
扩展Wain的评论:
>您可以在UIImage中渲染父视图;
>然后将此图像设置为新视图的背景.
这是Swift中可能的实现:
override func viewDidLoad() { super.viewDidLoad() // render parent view in a UIImage UIGraphicsBeginImageContext(self.view.bounds.size); self.parent?.view.layer.render(in: UIGraphicsGetCurrentContext()!) let viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); // add the image as background of the view self.view.insertSubview(UIImageView(image: viewImage),at: 0)