1

I have a question : How to make UIviewcontroller be transparent. I want to make background image of iPhone as the background image as my application

I want to make a interface like the this sujet:Creating a blurring overlay view

the code works very well:

if !UIAccessibilityIsReduceTransparencyEnabled() {
        self.view.backgroundColor = UIColor.clearColor()

        let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light)
        let blurEffectView = UIVisualEffectView(effect: blurEffect)
        //always fill the view
        blurEffectView.frame = self.view.bounds
        blurEffectView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]

        //self.view.addSubview(blurEffectView) //if you have more UIViews, use an insertSubview API to place it where needed
        self.view.insertSubview(blurEffectView, atIndex: 0)
    }
    else {
        self.view.backgroundColor = UIColor.clearColor()
    }

But after self.view.backgroundColor = UIColor.clearColor(), the background of my application est always white...the background is not transparent...

I want to make the background of application transparent to show the image background of iPhone, how to do it ?

PS: I have second solution to show background image of iPhone as the background image as my application, it is get the background image of iPhone...but How can I get the background image of iPhone before starting application?

Thank you for all of you.

Community
  • 1
  • 1
user2262304
  • 329
  • 1
  • 3
  • 10
  • 1
    View **controllers** can't be transparent...or any color at all. They aren't visible objects, views are. (I'm not trying to be petty here. It makes a big difference when you're trying to find useful answers.) – Phillip Mills Apr 29 '16 at 12:26
  • Thank you for your answer. and than, how to make the background image of iPhone as background image of application ? How I can get background image of Iphone ? Thank you very much – user2262304 Apr 29 '16 at 12:56
  • I don't think what you're trying to do is possible on a non-jailbroken device. – Andrew Madsen Apr 29 '16 at 16:07

0 Answers0