这是交易...我无法让UINavigation栏显示在我的一个观点上。 我在IB中的NavigationViewController中完成了所有操作并通过IB转向导航栏,因为我不想在我的大多数应用程序中使用它,但是当我尝试通过代码显示导航栏时,它不显示。
这是我用来尝试让导航栏显示的代码......但是没有用:
[self.navigationController setNavigationBarHidden:NO animated:YES]; [self.navigationController setNavigationBarHidden:NO]; self.navigationController.navigationBarHidden = NO; self.navigationController.navigationBar.hidden = NO;任何帮助将不胜感激
恭敬地,马特
Here's the deal... I can't get the UINavigation bar to appear on one of my views. I have the whole thing in a NavigationViewController in IB and turned of the navigation bar though IB because I don't want it in most of my app but when I try to show the navigation bar via code, it doesn't show up.
here's the code I used to try to get the nav bar to show up... but didn't work:
[self.navigationController setNavigationBarHidden:NO animated:YES]; [self.navigationController setNavigationBarHidden:NO]; self.navigationController.navigationBarHidden = NO; self.navigationController.navigationBar.hidden = NO;Any help will be greatly appreciated
respectfully, Matt
最满意答案
您编写的代码只能在UINavigationController的一个控制器内部工作,而不能在视图中工作。
因此,如果从视图中调用它,则应将self替换为放置此视图的控制器名称。
The code you write should only work inside of one of UINavigationController's controllers, not views.
So, if you call it from your view, you should replace self with controller name,in which this view is placed.
更多推荐
发布评论