How can I get a transparent background in my iOS app so I can see the Home Screen wallpaper?
Asked Answered
M

3

9

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.

Macias answered 20/9, 2013 at 9:22 Comment(1)
what do for this please show meHolofernes
H
10

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]

Haze answered 20/9, 2013 at 19:28 Comment(9)
Excellent, thanks. Don't know why I couldn't find that -- as soon as I searched UIApplicationIsOpaque though, I got some some results. Many thanks for following up.Macias
@GordonTucker for me it also works on the simulator. of course you must set a homescreen wallpaper in the simulator first.Dagostino
This is a private API. Unfortunately iTunes Connect won't accept app bundles with UIApplicationIsOpaque in their Info.plist.Gutow
I am starting to hate the fact that Apple added all these really cool layered effects and made a big deal about it, only to not allow developers to do the same things. Even the glassy blur effects should have been a defined background color :(.Phemia
Update 7.0.3 botched this method... :(Corollary
It used to, but I believe 7.0.3 removed the ability.Haze
No, i am getting only black screen if i follow the above solution. Will u please clarify itMasterstroke
I updated the answer, since it is no longer possible as of 7.0.3Haze
What a shame indeed :(( been 4 years and still no way afaikBrittne
O
4

Good news. From iOS 13, the background transparency can finally be enabled for all third-party apps. It’s no longer a private API.

In your app’s Info.plist file, set the boolean value for UIApplicationIsOpaque to NO.

And now the user’s wallpaper is visible inside your app.

Olcott answered 14/6, 2019 at 6:26 Comment(2)
it was confirmed that this is actually a bug and the app might get rejected because of it: twitter.com/develobile/status/1139699571498426368Townshend
That "confirmation" doesn't really look that legit to me... does this person actually know Craig Federhigi and does Craig actually have time to bother checking if something like this was intentional by the sub-teams of his teams? Hmm.. - still, I didn't get it working.Wile
I
2

It's not possible in iOS. While your app is running it does not mean that there is home screen behind your app.

However, If you do want to do it, there is a way that you make your app go in background, take screenshot and use that image as your background which will feel like home screen.

See this post. In this link, the accepted answer gives a way to take screenshot of home screen while your app is in background. But that's been achieved through a private API, which means your app probably will get rejected by App Store on time of submission.

Intervene answered 20/9, 2013 at 9:38 Comment(1)
Yes, that makes sense that it's not actually there. It's a shame they wouldn't open that up as they're using it in their own apps... Thanks for the response. D.Macias

© 2022 - 2024 — McMap. All rights reserved.