Thursday 5 December 2013

Add UINavigationBar to modal UITableViewController

ViewController *vc = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
UINavigationController *navC = [[UINavigationController alloc] initWithRootViewController:vc];
[self.navigationController presentModalViewController:navC animated:YES];
 
Now , you'll add UINavigation items over this viewcontroller
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"YOUR_IMAGE_NAME_WITH_EXTENSION"]];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Cancel" style:UIBarButtonItemStyleDone target:self action:nil];

No comments:

Post a Comment