在风景中查看显示为肖像

时间:2013-12-16 16:33:45

标签: ios iphone objective-c

我有一个仅在横向模式下运行的应用程序...它运行良好,但我确实在我的应用程序中创建了另一个视图,他的xib是“landscape”,没有使用autolayout并且在我的控制器中实现了shouldAutoRotate。 。但是当我进入这个视图时,视图与xib完全不同

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return ((toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight));
} 

xib的印刷品 http://imageshack.us/photo/my-images/38/3t2b.png/

ipad的印刷品 http://imageshack.us/photo/my-images/196/nqku.png/

2 个答案:

答案 0 :(得分:1)

在信息plist检查值

支持的界面方向

只保留这两项

  1. 风景(左主页按钮)
  2. 风景(右主页按钮)

答案 1 :(得分:0)

我使用以下方法解决了我的问题:

[self presentViewController:_inAppPurchaseView animated:FALSE completion:nil];

而不是:

  [self.window addSubView:_inAppPurchase.view];