Hello everyone, it seems like it should be simple; I really hope so. As always, thanks in advance!
All I'm trying to do is add a background image to a grouped tableview style. I use the following method in viewDidLoad:
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];
Unfortunately, background.png seems to be drawn not only by cells, but also against the background of cells and headers as follows:
alt text http://www.freeimagehosting.net/uploads/194449ffc1.png
I know that on this site there are several questions devoted to similar problems, but I am afraid that I can’t work. How to set background UITableView (tableview style - "Grouped") to use image? made me add
self.tableView.opaque = NO;
self.tableView.backgroundView = nil;
to view DidLoad and add
cell.backgroundView = nil;
cell.opaque = NO;
. , .
cell.backgroundColor = [UIColor clearColor];
. , , . , , . , . , , . !
*
*
*
:
*
*
*
, . DidLoad:
UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
bgView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];
[self.tableView.window addSubview:bgView];
[self.tableView addSubview:bgView];
[self.tableView sendSubviewToBack:bgView];
, , , , , , :
alt text http://www.freeimagehosting.net/uploads/c02dd68e20.png
, , - , . . .
, :
UIView UITableView UITableViewController