I am new to iOS. I am planing to display in a UIView the wallpaper image that is set on the iPhone where the app is installed. How to do this?

Here is the code I have so far:

[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"example.png"]]];

Instead of example.png I want to take programatically the name of the imageview set in the wallpaper.

有帮助吗?

解决方案

You can't, since the your app is sandbox you can not access file out side of your apps sandbox. And since Apple does not provide any API to access the background you will not be able to access it.

其他提示

It's impossible. This functionality is not available for 3rd party developers, due to privacy concerns.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top