Locating the UIView that UITableView scrolls over
Posted
by
Coocoo4Cocoa
on Stack Overflow
See other posts from Stack Overflow
or by Coocoo4Cocoa
Published on 2009-04-19T18:21:16Z
Indexed on
2011/03/13
8:10 UTC
Read the original article
Hit count: 214
Hi all,
I'm working on trying to obtain the UIView that UITableView scrolls over, if scrolling is enabled. Typically, the background is white, and if you push the UITableView out of its bounds, you'll see a background. I'm trying to set this background to a UIColor of blackColor. I can't seem to find the appropriate one to tag. I've tried the following code in my UIViewController:
- (void)loadView
{
[super loadView];
UITableView *aTableView =
[[[UITableView alloc]
initWithFrame:self.view.bounds
style:UITableViewStylePlain] autorelease];
[aTableView setScrollEnabled:YES];
[self.view setBackgroundColor:[UIColor blackColor]];
[self.view addSubview:aTableView];
self.tableView = aTableView;
}
The color still stays white. Seems I'm hitting the wrong UIView.
Any idea? Thanks.
© Stack Overflow or respective owner