如何在我的 iOS 应用程序中获得透明背景,以便我可以看到主屏幕壁纸? [英] How can I get a transparent background in my iOS app so I can see the Home Screen wallpaper?

查看:11
本文介绍了如何在我的 iOS 应用程序中获得透明背景,以便我可以看到主屏幕壁纸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很确定这将是直接的,因为这可能是不可能的.

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.

  1. 在项目plist

在应用委托加载函数中:

In the app delegate load function:

self.window.backgroundColor = [UIColor clearColor];

self.window.opaque = NO;

设置UIViewController.view的背景色为[UIColor clearColor]

这篇关于如何在我的 iOS 应用程序中获得透明背景,以便我可以看到主屏幕壁纸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆