我有一个小问题:我想在 TableViewController 中将图像设置为背景。我试过这个:
class SquadreController: UITableViewController {
override func viewDidLoad()
{
super.viewDidLoad()
var sfondo = UIImage(named: "sfondo")
self.view.backgroundColor = UIColor(patternImage: sfondo!)
}
然后我给 View 添加模糊效果,像这样:
let blur = UIBlurEffect(style: UIBlurEffectStyle.Light)
let blurView = UIVisualEffectView(effect: blur)
blurView.frame = self.view.bounds
view.addSubview(blurView)
但是有个大问题。我在 TableView 中工作,TableView、TableCell、NavigationItem 等在我应用模糊后都消失了。有人可以帮助我吗?
非常感谢!
最佳答案
尝试使用 view.insertSubView(blurView, atIndex: 0)
而不是 view.addSubview(blurView) 作为! UIImageView
关于ios - 具有图像背景和模糊效果的 TableView - swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31689024/