A quick collection of code snippets or the joy of navigating a sometimes quirky SDK.
Setting a pattern as background to an UIView, a category method I added to UIViewController:
- (void)makePatternedBackground {
UIImage *tile = [UIImage imageNamed:@"viewBackground-tile.png"];
UIColor *pattern = [[UIColor alloc] initWithPatternImage:tile];
[self.view setBackgroundColor:pattern];
[pattern release];
}
The png image is a 16×16 pixel pattern created in Photoshop.
Rounded corners for images [...]