1

我有一个支持所有方向的 iPad 应用程序......我的问题在于应用程序的启动。在landScapeRight 和landScapeLeft 和纵向(顶部主页按钮)的情况下,视图显示正确,但是当应用程序以纵向(底部主页按钮)启动时,视图以横向模式显示......我已经实现了

- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

当我更改应用程序方向时,视图正确显示。

4

1 回答 1

0

我也遇到过这个问题。在挖掘了https://devforums.apple.com之后 ,看来这可能是一个错误。有人推荐了一种解决方法,并且对我有用。

步骤 1。在 XCode4 中(或通过 Info.plist 文件)将支持的方向限制为 UIInterfaceOrientationLandscapeLeft、UIInterfaceOrientationLandscapeRight

步骤 2。仍然通过以下方式对所有界面方向返回 YES:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

这将使您的应用程序以横向模式启动,但允许用户在运行时将其旋转到他们想要的任何模式。这将纠正您遇到的渲染问题。


可以在此处找到类似的问题/答案: 横向模式仅适用于 iPhone 或 iPad

于 2011-04-30T04:51:12.253 回答