【发布时间】:2011-01-21 08:03:05
【问题描述】:
我有一个带有UITableView 菜单的iPhone 应用程序。 When a row in the table is selected, the appropriate view controller is pushed onto the application's UINavigationController stack.
我的问题是MenuViewController 不需要工具栏,但被推入堆栈的UIViewControllers 需要。每个被推送的UIViewController 在viewDidAppear: 中调用setToolbarHidden:animated:。要隐藏工具栏,我在viewWillDisappear: 中调用setToolbarHidden:animated:。
显示工具栏有效,这样当推送的视图出现时,工具栏会向上滑动并且视图会正确调整大小。但是,当按下后退按钮时,工具栏会向下滑动,但视图不会调整大小。这意味着当另一个视图过渡时,视图底部有一条黑色条带。我尝试在隐藏工具栏之前将工具栏的高度添加到视图的高度,但这会导致视图在过渡,以便仍然有一个黑条。
我意识到我可以管理自己的 UIToolbar,但为了方便,我想使用 UIToolbar 中内置的UINavigationControllers。
This forum post 提到了同样的问题,但没有提到解决方法。
【问题讨论】:
标签: iphone cocoa-touch uikit uinavigationcontroller uitoolbar