Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
532 views
in Technique[技术] by (71.8m points)

ios7 - How can I get a transparent background in my iOS app so I can see the Home Screen wallpaper?

I’m fairly sure this is going to be straight forward in that it’s probably not possible.

Basically, I’d like to be able to lightly see the background wallpaper through my view in the same way that the new Newsstand app does.

I've tried changing the alpha value of the view, and the background color to clear, but neither of these seem to do it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Apple has removed the ability to use this api in 7.0.3. What a shame.

You certainly can in iOS7, at least as of a few days ago. In our app once you set the following it makes your background transparent and shows the user wallpaper. If you try to programmatically take a screenshot, it will just show black instead.

  1. Set UIApplicationIsOpaque to false in the project plist

  2. In the app delegate load function:

    self.window.backgroundColor = [UIColor clearColor];

    self.window.opaque = NO;

  3. Set the UIViewController.view's background color to [UIColor clearColor]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...