how to create a UIView with a UINavController and

2019-08-27 17:30发布

问题:

I have an App and, when I press the 'i' button, to show the About App view, I need to have a view, with a background image, with a UINavigationController and a UITableView. How can I achieve that, with InterfaceBuilder, or progamatically? It's not done in AppDelegate. I need it to be done on a view. I have the following code, but it only creates the UINavController and the UITableView. But with this code I'me unable to put a UIImage in the background:

UITableViewController *tableViewController = [[UITableViewController alloc] initWithStyle: UITableViewStyleGrouped];
tableViewController.title = @"About";

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: tableViewController];

navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:navController animated:YES];

[navController release];
[tableViewController release];

How can I do it?

Thanks, RL

回答1:

Not sure if this will work but worth at try:

tableViewController.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"whatever.png"]];