I'm experimenting with programmatically adding a subview below my UITableView. I'm using a map curl sample from Erica Sadun's book in order to test to see if the view below my UITableView is indeed the view I'm adding. However, when the UITableView curls up, the view color of the view below is white, not the black view I'm adding in the code below. Any idea what I'm doing wrong to insert my new view below the UITableView?
CGRect frame = [self.tableView frame];
NSLog(@"frame height: %f, frame width: %f", frame.size.height, frame.size.width);
NSLog(@"tableView origin: %f, %f", [self.tableView frame].origin.x, [self.tableView frame].origin.y);
NSLog(@"frame origin x: %f, y: %f", frame.origin.x, frame.origin.y);
UIView *pickerView = [[UIView alloc] initWithFrame:frame];
pickerView.backgroundColor = [UIColor blackColor];
pickerView.frame = frame;
pickerView.userInteractionEnabled = YES;
[self.tableView insertSubview:pickerView belowSubview:self.tableView];
Also my top level view has been confirmed to only have two views. Here's the output from [self.view subviews]
:
2008-12-23 20:44:20.923 MySample[11966:20b] subviews: (
<UITableView: 0x523ea0>,
<UINavigationBar: 0x528b10>
)