Iphone 仅限iPad横向(左侧或右侧)
我正在建立一个应用程序,我希望它是风景只,即使旋转。 在仔细阅读之后,我设置了一系列代码,如下所示:Iphone 仅限iPad横向(左侧或右侧),iphone,ipad,landscape,Iphone,Ipad,Landscape,我正在建立一个应用程序,我希望它是风景只,即使旋转。 在仔细阅读之后,我设置了一系列代码,如下所示: - (BOOL)shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);} 这是可行的,但我希望界面旋转,但总是在横向模式只有,与左或右主按钮
- (BOOL)shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);}
这是可行的,但我希望界面旋转,但总是在横向模式只有,与左或右主按钮,像许多其他应用程序做
如何实现这一点?您非常接近,只需支持所有横向方向,使用
UIInterfaceOrientationIsLandscape
宏即可轻松实现
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
非常接近,只需支持所有横向方向,使用
UIInterfaceOrientationIsLandscape
宏即可轻松完成
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
试试这个:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
试试这个:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
这是一个有用的链接,描述了如何在iPhone上构建一个只支持风景的应用程序,但它也可以在iPad上运行。
这是一个有用的链接,介绍了如何在iPhone上构建一个只适用于风景的应用程序,但它也适用于iPad。