Domanda

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.

È stato utile?

Soluzione

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.

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top