【发布时间】:2012-04-04 17:28:53
【问题描述】:
我正在为 iPad 制作应用程序。 我有一个必须保持在横向的视图控件,这很好用。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
从这个视图我推向另一个视图,当用户倾斜他的 ipad 时,这个子视图应该旋转到适当的旋转(横向或纵向)。 在这个子视图中,我使用此代码来实现这一点,但它不起作用。它贴在风景上。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
【问题讨论】:
标签: objective-c view rotation landscape-portrait