tags:

views:

965

answers:

6

is it possible to change the iPhone background from code?

+7  A: 

Nope, you can only save a picture for the user to set as a background.

Mel
what if the user sets a background image and I'll dynamically change it?
Chen Kinnrot
Unfortunately you can't overwrite photos either.Check rpetrichs answer for a possible solution, but as he said, it won't work on the appstore.
Mel
+2  A: 

Mel is correct, there's no way to skip over the save process.

The reason this will always be the case:

Apple doesn't want apps to be able to set the background immediately upon opening. Theoretically, they could have a permission box (like the location dialog), but I doubt that will happen anytime soon.

mclaughlinj
Maybe in iPhone 3.0?
Isaac Waller
+4  A: 

If you write a new png to /User/Library/LockBackground.png and then call notify_post(" com.apple.language.changed"); the device will respring and your new background will be present.

This isn't technically a private API, but does fall outside of what Apple allows on the store.

rpetrich
A: 

But I hv seen an application which can change the iPhone background image(unlocked screen).

faisal
A: 

I am making an application though which user will be able to see, preview and save it as wallpaper that becomes background of iphone main screen. Can i do this programatically or not? Which iphone versions supports changing wallpapers from our custom made application?

mayur
Submit this as a question.
kirk.burleson
A: 

hey faisal,

which app you have seen that allows you to set any user selected picture as a background. Can i allow user to select any picture and set it as background?

mayur