0

I'm having a viewcontroller that has a blurview as background so that you can see the underlying viewcontroller.

This works great except when you want to present the modalviewcontroller in a navigationController. Then you see the blurview for a sec and then it is just white and you can't see the underlying viewcontroller.

I tried to set the navigationcontroller.view.backgroundColor to clear but this doesn't work.

How can I achieve this?

 let vc: FilterViewController = FilterViewController()
 vc.modalPresentationStyle = .overFullScreen
 vc.delegate = self
 let navCtrl = UINavigationController(rootViewController: vc)
 navCtrl.view.backgroundColor = .clear
 self.navigationController?.present(navCtrl, animated: true, completion: nil)
Ravi Prakash Verma
  • 1,484
  • 1
  • 15
  • 22
user1007522
  • 7,858
  • 17
  • 69
  • 113
  • I don't know if this will help but if you are having troubles solving this issue, you could get a snapshot of this blurView and add it as a background before it becomes white. – Matthias Nov 25 '16 at 15:12
  • but then I lose the transparency. The view needs to be visible. – user1007522 Nov 25 '16 at 15:19
  • Does it moves behind ? because if so, thats true. If it doesn't move while you present the modal, you can have your bluredView (before it gets white) snapshoted, make the snapshot as your background, and the user will not notice that it's not the real-time transparency. Another way to solve your problem could be to add your ViewController as a childViewController of your navigationController, and of course add it's view to the NavigationController View – Matthias Nov 25 '16 at 15:37

1 Answers1

0

you want a screen to blur another screen? it's not so easy but possible...

enter image description here

it's a bit difficult to paste this here, so will give you a link

DeyaEldeen
  • 10,847
  • 10
  • 42
  • 75
  • I'm doing it like that but when you put the modal viewcontroller in a navigationcontroller it doesn't work anymore. – user1007522 Nov 25 '16 at 15:26
  • the last thing i can help with is this link : http://stackoverflow.com/questions/19177348/ios-7-translucent-modal-view-controller – DeyaEldeen Nov 25 '16 at 15:29