0

iPad用の横向きアプリを作成していますが、アプリケーションを実行すると、ホーム画面が縦向きで表示されます。どうすれば解決できますか?

4

3 に答える 3

1

ターゲットを選択します。「サポートされているデバイスの向き」で「LandscapeLeft」と「LandscapeRight」オプションのみを選択します。また、rooviewコントローラーセットでも選択します。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if(UIInterfaceOrientationIsLandscape(interfaceOrientation))
        return YES;
    return NO;
}
于 2012-07-09T06:39:08.893 に答える
0

アプリがプロジェクト設定で横向きのみをサポートしていることを確認します([縦]と[逆さま]の選択を解除します)。

Xcode4プロジェクト設定

ランドスケープをサポートするViewControllerも、サポートしていると言う必要があります。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
于 2012-07-09T06:38:25.240 に答える
0

この方法を追加します

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{

// Return YES for supported orientations
NSLog(@"Changed interface orientation");

return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)
        );

}
于 2012-07-09T07:02:00.927 に答える