I am making an iPhone app, and I want know how make a variable background image a background that the user can choose one of the options ?
Asked
Active
Viewed 4,021 times
2 Answers
8
I don't know what you want in the foreground, but anything based on the UIView class has a backgroundColor
property that you can set to an image like this:
yourView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"YourImage.png"]];

Matthew Frederick
- 22,245
- 10
- 71
- 97
0
It didn't work for me, what it worked was:
self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background.png"]];
I think is the same, but don't know why the other answer didn't work for me.
Hope it helps.

Shark Lasers
- 441
- 6
- 15

larsnow
- 25
- 5