1

I have an app, haven't modified it since 6 months ago, anyway I decided to open it up in the simulator. But the first viewcontroller which shows after the splash screen is scrunched up and is showing through the wrong orientation. It's showing in portrait when it should be showing in landscape.

This is the code for it:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

However,

When I tap to go to another view, then go back to the main viewcontroller, the problem fixes itself and the orientation is correct.

正しく表示

So it only happens on the initial launch after the splash screen is shown.

Please join the links together to view the screenshots as i cannot post images as i haven't got 10 reps yet.

4

2 に答える 2

0

plist ファイルを開きます ->addRow -> 「初期インターフェイスの向き」を追加し、値に横向き (ホーム ボタンの左) を指定します。

これがあなたを助けることを願っています。

于 2013-02-28T13:48:22.880 に答える
0

ここに画像の説明を入力 これにより、アプリが横向きモードで開くようになります。

AppDelegate では、これを使用している可能性があります

[self.window addSubView:viewControllerObj]

問題は上記の行にありました。向きは iOS 5 では上記の行で適切に機能しますが、iOS 6 では、向きを適切に機能させるために、上記の行を次のように変更します。

[self.window setRootViewController:viewControllerObj]

次に、向きが変わるとアプリが回転します

于 2013-02-28T12:21:20.230 に答える