Swift3 第二个controller为半透明

2017-06-30  本文已影响0人  文瑶906

前言

本代码是使用swift3 ,
Xcode:8.XX(忘记了,懒得看,你削我啊)
时间:2017.6.30

关键代码

    func clickBtn(){
        let secod = SecondVC()
        self.modalPresentationStyle = .custom
        self.definesPresentationContext = true

        secod.view.backgroundColor = UIColor.init(red: 255/255.0, green: 255/255.0, blue: 255/255.0, alpha: 0.5)
        secod.modalPresentationStyle = .overCurrentContext
        self.present(secod, animated: true, completion: nil)
    }
}

上边的代码是从 下边的地址 copy 过来的。前人的树,真凉快。
代码地址

上一篇 下一篇

猜你喜欢

热点阅读