Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

contemascetti

macrumors newbie
Original poster
Dec 30, 2010
3
0
Hi. I have a small problem putting a navigation controller inside a splitview controller inside a tabbar controller. I do all the work programmatically without interface builder.
The problem is that the navigation controller seems to place itself a bunch of pixels below its original supposed position. This problem only happens with navigation controller, i tried with tableviews and customized simple views and they fit correctly immediately beneath the ipad top bar.
I include a screenshot of that:
Schermata%202010-12-30%20a%2009.39.59.png

The code is the one below (tabbar and splitview are defined in the appdelegate, this is the viewcontroller placed on the left of the splitview):

Code:
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
	
	userKindTableViewController=[[UITableViewController alloc] init];
	
	navigationController=[[UINavigationController alloc] initWithRootViewController:userKindTableViewController];
	
	userKind=[[UITableView alloc] initWithFrame:navigationController.view.frame style:UITableViewStyleGrouped];
	userKind.dataSource=self;
	userKind.delegate=self;
	[userKind reloadData];
	
	userKindTableViewController.tableView=userKind;
	userKindTableViewController.title=@"Categorie utenti";
	
	self.view=navigationController.view;
}

Thank you!
 
A simple solution might be to drag the Nav bar up higher than you want it in Interface Builder and then see if it lines up when you build and run.

Nick
 
A simple solution might be to drag the Nav bar up higher than you want it in Interface Builder and then see if it lines up when you build and run.

Nick

As I said i'm not using Interface Builder at all, partly because i need to make complex and frequent changes to the UI via code...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.