我有一个关于视图控制器上的blureffects的问题。出于几个原因,我手动编写了我所有的segues。但是当我打开一个背景模糊的视图控制器时,我只看到一个深灰色的背景。如何解决视图控制器模糊效果覆盖在另一个视图控制器上的问题,在这个视图控制器上可以看到前一个视图控制器的内容?
模糊效果现在由具有透明背景视图的故事板应用。
我的seque代码是:
操作:
@IBAction func ToUserSections(_ sender: Any) {
let controller =
Navigation.getDestinationViewControllerWith("User",
controllerName: "UserSectionsVC")
present(controller, animated: false, completion: nil)
}类:
class Navigation{
static func getDestinationViewControllerWith(_
storyboardName:String, controllerName:String)-> UIViewController{
let storyboard = UIStoryboard(name: storyboardName, bundle: nil)
let controller =
storyboard.instantiateViewController(withIdentifier:
controllerName) as UIViewController
return controller
}}
希望你能帮助我,因为它将最大限度地美观的应用程序:D
发布于 2017-09-18 17:52:48
尝尝这个。
let viewController : CustomViewControlller = UIStoryboard.getMainStoryboard().instantiateViewController(withIdentifier: "Identifier") as! CustomViewControlller
viewController.modalPresentationStyle = .overCurrentContext
viewController.modalTransitionStyle = .crossDissolve
self.present(viewController, animated: true, completion: { _ in })发布于 2017-09-18 23:33:06
好的,让其他人知道,对我起作用的是:
在IBAction:在演示之前添加以下代码行
controller.modalPresentationStyle = UIModalPresentationStyle.overFullScreen如下所示:
@IBAction func ToUserSections(_ sender: Any) {
let controller = Navigation.getDestinationViewControllerWith("User", controllerName: "UserSectionsVC")
controller.modalPresentationStyle = UIModalPresentationStyle.overFullScreen
present(controller, animated: false, completion: nil)
}https://stackoverflow.com/questions/46275720
复制相似问题