I need to set some background image for my view. How can I do this?
A:
The simpliest way is to add an imageView to your view with appropriate background image. Just make sure that it is the lowest by z-order subview by adding it first or by calling [view sendSubviewToBack:backGroundView];
As an alternative you can set your image as a contents for your view's layer:
#import <QuartzCore/QuartzCore.h>
...
view.layer.contents = yourImage.CGImage;
Vladimir
2010-10-26 11:05:41
+3
A:
view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];
loomer
2010-10-26 11:07:49
Oops, forgot about this option. nice one
Vladimir
2010-10-26 11:38:32