I have a little problem: I'd like to set an image to background in a TableViewController. I tried this:
class SquadreController: UITableViewController {
override func viewDidLoad()
{
super.viewDidLoad()
var sfondo = UIImage(named: "sfondo")
self.view.backgroundColor = UIColor(patternImage: sfondo!)
}
Then I give the blur effect to the view, like this:
let blur = UIBlurEffect(style: UIBlurEffectStyle.Light)
let blurView = UIVisualEffectView(effect: blur)
blurView.frame = self.view.bounds
view.addSubview(blurView)
But there is a big problem. I'm working in a TableView and the TableView, TableCell, NavigationItem, etc. have all disappeared after I apply the blur. Can someone help me?
Thanks a lot!
Try using view.insertSubView(blurView, atIndex: 0)
instead of view.addSubview(blurView) as! UIImageView
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With