我将 Iphone 应用程序转换为通用应用程序,我创建了一个特定于 Ipad 的 View Controller 来处理 View ,但是 View 不旋转,我看不到我缺少什么。
View 上的shouldAutorotateToInterfaceOrientation 总是返回 yes 但 View 不会移动。
它在标签栏应用程序结构中
标签栏 Controller > 导航 Controller > View Controller
并且两者都没有锁。
最佳答案
您是否使用支持的方向更新了应用程序的 Info.plist 设置?
您可以点击左侧的项目名称 -> Targets -> Summary 并根据设备点击支持的方向。
您也可以通过编辑 plist 文件或使用属性列表编辑器添加新行来直接将其添加到 plist 文件中。
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
关于iphone - 转换为通用应用程序 - View 不会旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6456807/