【问题标题】:Rotate a UIViewController旋转 UIViewController
【发布时间】:2011-11-18 23:54:18
【问题描述】:

我有一个导航视图控制器。当我选择一个 tableview 单元格时,它会从 UIInterfaceOrientationPortrait 状态推送一个新的 ViewController。

现在,如果我旋转新的 ViewController 横向模式并弹出新的 ViewController 并返回表格视图 Navigation Controller 主页,那么我可以看到,NavigationController 主页是它以前的 UIInterfaceOrientationPortrait 模式,我看不到楼下的部分我的 tableView 界面。

我将如何解决这个问题,如果我弹出 newViewController,主导航 ViewController 页面将查看实现 newViewController 的方向模式的方式。

这意味着如果 newViewController 处于横向模式,则主页将自动横向模式,如果 newViewController 处于纵向模式,则主导航页面将自动纵向模式。

任何解决方案????

【问题讨论】:

    标签: iphone uiinterfaceorientation


    【解决方案1】:

    在所有视图控制器(在导航堆栈中)实现文件中添加以下内容。

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
    
        return YES;
    }
    

    【讨论】:

      猜你喜欢
      • 2012-03-27
      • 2010-10-07
      • 2011-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多