【问题标题】:UINavigationController switch views - slide from right to leftUINavigationController 切换视图 - 从右向左滑动
【发布时间】:2010-01-05 17:24:18
【问题描述】:

我正在尝试在视图之间切换。 这些类继承自 UINavigationController。 我在 IBAction 中使用此代码:

    CellSubview *personView = [[CellSubview alloc] init]; // The new navigation controller
 self.modalTransitionStyle = 0; // tried all 3 of the options
 [self presentModalViewController:personView animated:YES];
 [personView release];

何时:

     @interface CellSubview : UINavigationController

我只是不能让视图向右滑动。 (就像大多数应用程序一样)

它总是来自自下而上而不是选项:

  personView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
  // or
  personView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

我只希望 oldViewController.view 向左滑动,newViewController.view 从右侧进入。

感谢您的建议

伊泰

【问题讨论】:

    标签: iphone animation uinavigationcontroller transition


    【解决方案1】:

    modalTransitionStyle 属性必须在视图控制器上设置,以模态方式呈现,在您的情况下是在 personView 上。

    【讨论】:

      【解决方案2】:

      不要使用presentModalViewController:。使用

      [self.navigationController pushViewController:personView animated:YES];
      

      如果要在新屏幕上隐藏导航栏,请使用

      [self.navigationController setNavigationBarHidden:YES animated:YES];
      

      【讨论】:

        猜你喜欢
        • 2012-11-18
        • 2013-10-19
        • 1970-01-01
        • 1970-01-01
        • 2013-01-04
        • 2016-03-20
        • 2012-11-27
        • 2021-11-28
        • 2010-10-10
        相关资源
        最近更新 更多