views:

230

answers:

1

I'm adding my first UITableView and it draws in an unexpected manner. There's a gap (same size as topBar?) between the top of the UITableView and the topBar (referring to the line with the battery indicator).

#import "SettingsController.h"
UIView     *settingsView;
UINavigationController *navigationController;

SettingsController *rootViewController = 
   [[SettingsController alloc] initWithStyle:UITableViewStyleGrouped];
UINavigationController *navigationController =  
   [[UINavigationController alloc] 
   initWithRootViewController:rootViewController];
settingsView = navigationController.view;
[self.view insertSubview:settingsView atIndex:0];

How can I move the UITableView to align with the bottom of the topBar?

+1  A: 

Change your view frame.

CiNN
Thanks - I was having problems initializing a frame, but this was exactly right.I used:settingsView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
BankStrong