当模态呈现时,NavigationBar隐藏在detailViewController中

时间:2010-12-20 12:45:21

标签: iphone uisplitviewcontroller

我基本上将我的DetailViewController呈现为modalView。在modalView导航栏中永远不会显示,但我没有隐藏它。请帮助!

1 个答案:

答案 0 :(得分:0)

WriteReviewController *newReview = [[WriteReviewController alloc] initWithNibName:@"WriteReviewController" bundle:nil];

UINavigationController *modalNavController = [[UINavigationController alloc] initWithRootViewController:newReview];

// This is intended to be presented in another view controller class
modalNavController.navigationBar.barStyle = UIBarStyleDefault;  
[self.parentViewController presentModalViewController:modalNavController animated:YES]; 
[modalNavController release];

这段代码对我有用