How to set iPhone Wallpaper Programmatically

2019-02-20 01:02发布

I am developing an application in which I have to set image as the iPhone wallpaper (the background image on the "slide to unlock" screen). Do we have any API reference for this. Please help

Thanks in advance Parmeswar

2条回答
倾城 Initia
2楼-- · 2019-02-20 01:29
 NSString *str_mainMenu = [[NSBundle mainBundle] pathForResource:@"Unlock" ofType:@"jpg"];
    mainView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:str_mainMenu]];
查看更多
对你真心纯属浪费
3楼-- · 2019-02-20 01:32

Not presently, the only thing that you can do is save the image to the camera roll and give the user instructions on how to change their wallpaper using the new image.

查看更多
登录 后发表回答