Subview appears behind tableview

Posted by Banjer on Stack Overflow See other posts from Stack Overflow or by Banjer
Published on 2010-04-16T01:36:57Z Indexed on 2010/04/16 1:43 UTC
Read the original article Hit count: 533

When I add a subview to my UITableViewController, it seems to be underneath the tableview. I may be loading my subview incorrectly, or calling addSubview in the wrong place. The subview I'm referring to is the red area above the tabbar that also contains the "Click me" button:

screen shot

You can see that the cell lines kind of overlap. Here is where I'm adding the subview in my TableViewController:

- (void)viewDidLoad {
    [super viewDidLoad];
    CGRect hRect = CGRectMake(0, 170, 320, 480);
    HomeScreenOverlayView *homeView = [[HomeScreenOverlayView alloc] initWithFrame:hRect];
    [self.tableView addSubview:homeView];
    [homeView release];
}

Any ideas? Thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableviewcontroller