简体   繁体   中英

How to set image as a background image in iPhone

I have question that how could I set the ImageView image object as a background in my iPhone I use sdk 4.2 and in iPhone 4 its possible to set the backgound image in iPhone... So my case is that if some one likes the picture then they should give the UIAlertView to set as a background... OK & Cancel option in ok option its automatically set the image as a background.

My object are as follow:

UIImageView *imgViewObj = [[UIImageView alloc]init];
[imgView setImage:[UIImage imageWithName:@"sampleImage.png"]];

I have to set this imgView obj as a background image...

No, you cannot programatically set a user's wallpaper in iOS (yet anyway). You can probably do it on JB devices though, but that won't get you on the Apple appstore.

If you are talking about the iPhone background while you are outside of the app this is a repeat question. Otherwise in your own application just set contents of your root views layer to the CGImage you wish.

Setting iPhone wallpaper (locked screen background) programmatically?

How to set iPhone Wallpaper Programmatically

change wallpaper via iphone app

How to change wallpaper in iPad programmatically?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM