单击按钮后,当我的叠加 subview 添加到 super View 时,我希望能够使用模糊和鲜艳的视觉效果来遮盖背景 (UITableViewController)。通常,我会将视觉效果拖放到 Main.storyboard 中,但是,我无法将效果拖到 TableView 中。任何帮助将不胜感激
提前致谢!
最佳答案
您可以通过以下方式在主视图上添加模糊 View
@IBAction func addBlur(_ sender: Any) {
let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.light)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = view.bounds
blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(blurEffectView)
}
还有更多内容
let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.light)
您可以添加以下效果
extraLight
light
dark
regular //10.0 or higher
prominent //10.0 or higher
您还可以使用更多 this开源库提供更大的灵 active
关于ios - 在 TableView Controller 中的 TableView 上添加模糊 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45502743/