【发布时间】:2011-07-06 12:04:29
【问题描述】:
我以纵向模式开发了应用程序(导航+标签栏)。
但现在我希望用户将其方向更改为横向或 肖像,那么所有人都应该在那个方向上旋转。
【问题讨论】:
标签: iphone objective-c landscape landscape-portrait
我以纵向模式开发了应用程序(导航+标签栏)。
但现在我希望用户将其方向更改为横向或 肖像,那么所有人都应该在那个方向上旋转。
【问题讨论】:
标签: iphone objective-c landscape landscape-portrait
您需要设置每个视图的控件 autoresizingmask。您可以根据需要通过 xib 和代码执行此操作,并在所有视图控制器中添加以下方法,它应该可以工作。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
return YES;
}
希望对您有所帮助。
【讨论】:
看看你的“.plist”,你可以在这里定义“支持的界面方向”(UISupportedInterfaceOrientations)。
【讨论】: