美文网首页
swift 对于模态视图背景为半透明的设置

swift 对于模态视图背景为半透明的设置

作者: d5cbd4f07363 | 来源:发表于2018-12-07 09:36 被阅读7次

 let vc = YLJGoodsDetailSubViewController()

        vc.view.backgroundColor=UIColor(red:0, green:0, blue:0, alpha:0.5)

        vc.modalPresentationStyle = UIModalPresentationStyle.custom

        self.present(vc, animated:true, completion:nil)

1.在创建控制器的时候设置背景色及模式为.custom模式,不要在模态视图里边设置。

相关文章

网友评论

      本文标题:swift 对于模态视图背景为半透明的设置

      本文链接:https://www.haomeiwen.com/subject/sqbzcqtx.html