本文共 519 字,大约阅读时间需要 1 分钟。
在第一个ViewController做如下设置let controller = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("SecondViewController") as! SecondViewController controller.view.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.6) self.modalPresentationStyle = UIModalPresentationStyle.FullScreen self.presentViewController(controller, animated: true, completion:nil)到SecondViewController的ViewDidLoad()方法内添加以下代码,不然的话视图加载完后背影又变成了黑色self.modalPresentationStyle = .Custom
转载地址:http://eqwuo.baihongyu.com/