如何在我的iOS应用程序中获得透明背景,以便可以看到主屏幕墙纸? [英] 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.
我尝试将视图的alpha
值和背景色更改为clear
,但是这些似乎都没有.
I've tried changing the alpha
value of the view, and the background color to clear
, but neither of these seem to do it.
推荐答案
Apple已在7.0.3中删除了使用此api的功能.真可惜.
至少在几天前,您当然可以在iOS7中使用.在我们的应用程序中,一旦您设置以下内容,它就会使背景透明并显示用户墙纸.如果您尝试以编程方式拍摄屏幕截图,它将显示为黑色.
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.
-
在项目
plist
在应用程序委托加载功能中:
In the app delegate load function:
self.window.backgroundColor = [UIColor clearColor];
self.window.opaque = NO;
将UIViewController.view
的背景色设置为[UIColor clearColor]
这篇关于如何在我的iOS应用程序中获得透明背景,以便可以看到主屏幕墙纸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!