How to get a transparent background in an iOS app so that I can see the wallpaper on the main screen?

I am sure it will be simple, because it is probably impossible.

In fact, I would like to be able to easily see background wallpapers through my view, just like the new Newsstand application does.

I tried changing the alpha value of the view and clear background color, but none of them seem to do this.

+8
source share
3 answers

Apple has removed the ability to use this API in 7.0.3. What a disgrace.

Of course you can in iOS7 at least a few days ago. In our application, as soon as you install the following, it will make your background transparent and show the user's wallpaper. If you try to take a screenshot programmatically, it will simply show black.

  1. Set UIApplicationIsOpaque to false in the plist project

  2. In the application delegate download function:

    self.window.backgroundColor = [UIColor clearColor];

    self.window.opaque = NO;

  3. Set the UIViewController.view background of the UIViewController.view to [UIColor clearColor]

+11
source

This is not possible on iOS. While the application is running, this does not mean that your application has a home screen.

However, if you really want to do this, you can make your application in the background, take a screenshot and use this image as a background that will look like a home screen.

See this post. In this link, the accepted answer makes it possible to take a screenshot on the main screen when your application is in the background. But this was achieved using a private API, which means that your application is likely to be rejected by the App Store at the time of submission.

+3
source

Good news. In iOS 13, you can finally enable background transparency for all third-party applications. This is no longer a private API.

In the Info.plist file of your application, set the boolean value for UIApplicationIsOpaque to NO .

And now the user's wallpaper is visible inside your application.

+1
source

Source: https://habr.com/ru/post/954236/


All Articles