【问题标题】:Windows based iPad application orientation基于 Windows 的 iPad 应用程序方向
【发布时间】:2011-07-27 07:21:33
【问题描述】:

我想创建基于 iPad 窗口的应用程序,默认情况下支持方向窗口应用程序不支持方向如何在 iPad 中基于窗口的应用程序中启用方向支持。

谢谢

【问题讨论】:

  • 第 1 步:阅读 iOS 应用编程指南

标签: objective-c ipad screen-rotation


【解决方案1】:

窗口没有旋转功能。它在纵向模式下得到缓解。如果你想让某些东西随着设备旋转,你应该使用 UIViewController。它必须实现方法 shouldAutorotateToInterfaceOrientation 并为您的方向返回 true 或为所有方向删除它。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

您还应该在项目设置中更改它 (ProjectName-Info.plist)。

【讨论】:

    猜你喜欢
    • 2011-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-16
    • 1970-01-01
    • 2011-03-25
    • 1970-01-01
    相关资源
    最近更新 更多