Launching in Landscape Mode
Apps that uses only landscape orientations for their interface must explicitly ask the system to launch the appin that orientation. Normally, apps launch in portrait mode and rotate their interface to match the deviceorientation as needed. For apps that support both portrait and landscape orientations, always configure yourviews for portrait mode and then let your view controllers handle any rotations. If, however, your app supportslandscape but not portrait orientations, perform the following tasks to make it launch in landscape modeinitially:
- Add the UIInterfaceOrientation key to your app’s Info.plist file and set the value of this key toeither UIInterfaceOrientationLandscapeLeft or UIInterfaceOrientationLandscapeRight.
- Lay out your views in landscape mode and make sure that their layout or autosizing options are setcorrectly.
- Override your view controller’s shouldAutorotateToInterfaceOrientation: method and returnYES for the left or right landscape orientations and NO for portrait orientations.
App启动方向指导:如何让应用在横屏模式下启动
本文将详细说明如何配置应用,使其在仅支持横屏界面的应用启动时,明确请求系统在横屏模式下运行。包括在Info.plist中添加关键参数,确保视图布局正确,并在视图控制器中覆盖特定旋转方法。
1723

被折叠的 条评论
为什么被折叠?



