如何在我的iOS APP中制作可变背景图像

0 iphone xcode uiimage

我正在制作iPhone应用程序,我想知道如何使变量背景图像成为用户可以选择其中一个选项的背景?

Mat*_*ick 8

我不知道你想要什么在前台,但任何基于UIView类的东西都有一个backgroundColor属性,你可以设置为这样的图像:

yourView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"YourImage.png"]];
Run Code Online (Sandbox Code Playgroud)