Doug Molineux
Doug Molineux

Reputation: 12431

Setting the background image of iPhone from an app

I was wondering if it was possible to set the IPhone's background image from an App. I have an image which is a UIImageView. Like when the phone is locked theres the "wallpaper background image." Is there a way to make a button which can set the wallpaper of the phone as my UIImageView?

Upvotes: 0

Views: 615

Answers (2)

Doug Molineux
Doug Molineux

Reputation: 12431

I adjusted my google search to "wallpaper" terminology and I found this:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/36103-can-sdk-app-change-wallpaper-iphone.html

It appears this is only possible on a jailbroken iphone.

Upvotes: 1

Justin Meiners
Justin Meiners

Reputation: 11113

In your background view (you might have to drag an IBOutlet to it) say like:

imageView.bounds = view.bounds;
imageView.hidden = YES;
[view addSubview:imageView];

Then when your button is pressed (possibly an IBAction) do this to turn the background on and off.

if (imageView.hidden){
   imageView.hidden = NO;
}else{
   imageView.hidden = YES;
}

Upvotes: 1

Related Questions