将用户壁纸显示为UIWindow背景

将用户壁纸显示为UIWindow背景

本文介绍了iOS 7 - 将用户壁纸显示为UIWindow背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让iOS应用显示用户的壁纸? Apple在Safari中的标签视图和手机中的键盘等地方使用此功能。设置UIWindow的透明度无济于事......

How would it be possible to have an iOS app display the user's wallpaper? Apple uses this in places like the tab view in Safari and the keypad in Phone. Setting the transparency of UIWindow proved to no avail...

推荐答案

这已不再可用。太糟糕了,因为它允许甜蜜的原生效果

你需要做一些事情才能显示用户壁纸

there are a few things you need to do to show the user wallpaper

1 - 在项目plist中将UIApplicationIsOpaque设置为false

1 - set UIApplicationIsOpaque to false in the project plist

2 - 在app delegate load function中

2 - In the app delegate load function

self.window.backgroundColor = [UIColor clearColor];
self.window.opaque = NO;

3 - 将UIViewController.view背景颜色设置为[UIColor clearColor]

3 - set the UIViewController.view background color to [UIColor clearColor]

这对我们目前有用。如果您尝试进行屏幕截图或实际使用壁纸,它只会返回纯黑色(因此您无法对壁纸执行任何操作,因此隐私问题不适用。)

This works for us currently. If you try to do a screen capture or actually use the wallpaper it just returns solid black (so privacy concerns don't apply since you can't do anything with the wallpaper).

这篇关于iOS 7 - 将用户壁纸显示为UIWindow背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 19:42