【发布时间】:2012-12-11 06:58:57
【问题描述】:
我正在使用 ios sdk 5
我正在像这样从父视图控制器推送视图控制器
DetailsViewController *detailController = [[DetailsViewController alloc] initWithNibName:@"DetailsViewController" bundle:nil] ;
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:YES];
[self.navigationController pushViewController:detailController animated:YES];
因为我想以横向模式打开我的新控制器。我的父视图控制器处于 potrait 模式,所以我设置为
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
在我的子视图控制器中,我已将其设置为
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight;
}
但是,当我的子视图控制器打开时,它仍会旋转到横向模式,但内部视图(如滚动视图及其子视图)仍处于 potrait 模式。我已经阅读了很多类似的问题并尝试了它们,但它们都不适合我。请指出正确的方向,以了解如何在 viewcontroller 中旋转所有视图
谢谢
【问题讨论】:
标签: ios uiviewcontroller