0

I am converting an iPhone application to work on the iPad. In this case, the user interface was created with interface builder. The interface of the root controller (at index 0), consists of a Tab Controller & Navigation Controllers in this layout:

  • Tab Controller
  • Navigation Controller 1
  • Navigation Controller 2
  • Navigation Controller 3

I have been implementing this in pieces. When I setup the Tab Controller & Navigation Controller 1 as a first step, everything works correctly. willHideViewController & willShowViewController work correctly. My interface switches from SplitView to Popover correctly. When I add Navigation Controller 2, willHideViewController & willShowViewController never fire & I always see the Popover controller no matter what orientation the iPad is within the simulator.

When I add a second navigation controller, is there something else I need to tie off within the interface builder to get the interface to work correctly?

4

2 回答 2

0

我猜您已经为第一个导航控制器设置了一个委托,但没有为第二个导航控制器设置一个。委托对象将接收类似 willHideViewController 的方法。

我也不确定拥有多个导航控制器是一种好的风格。视图控制器知道它已被放置在导航控制器中,您可以使用 self.navigationController 访问它。您应该继续在同一个导航控制器上推送视图控制器。或者我可能误解了你想用你的标签控制器做什么。

于 2011-08-27T07:03:25.680 回答
0

答案很简单:当您实现拆分视图控制器并且希望所有内容从纵向正确切换到横向时,您需要确保所有界面元素都实现了纵向和横向布局的shouldAutorotateToInterfaceOrientation

于 2011-10-16T00:50:23.550 回答