Nex*_*Rev 3 xcode portrait orientation ipad
根据apple,我的应用程序必须能够以两种肖像模式运行.如何使用shouldAutorotateToInterfaceOrientation完成此操作?
无论接口方向是什么,只需返回YES.这将允许系统自动旋转到倒置方向.
如果您不想支持横向方向,请返回:
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
Run Code Online (Sandbox Code Playgroud)
此代码允许除横向以外的任何方向:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation
{
return (orientation != UIDeviceOrientationLandscapeLeft) &&
(orientation != UIDeviceOrientationLandscapeRight);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10687 次 |
| 最近记录: |