我有app,当我顺时针旋转iphone时,我需要显示我的报告UIViewcontroller只有横向模式。其他UIViewcontroller是Portrait模式。
OtherUIviewController
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
报告Uiviewcontroller
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
但是如何检查时钟明智的方向。任何样本//
答案 0 :(得分:3)
您需要同时检查UIInterfaceOrientationLandscapeRight
和UIInterfaceOrientationLandscapeLeft
。否则,如果主页按钮指向右侧,则只会旋转屏幕。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight)
|| interfaceOrientation == UIInterfaceOrientationLandscapeLeft;
}