2

これは私のAppDelegateにあり、向きの変更で実行されます。アプリケーションがロードされると、常にポートレートモードとしてロードされます。デバイスがランドスケープモードのときにアプリケーションをロードすると、デバイスがポートレートモードの場合と同じように実行されます。それが私が抱える最初の問題です。2つ目は、ロード後、デバイスを縦向きから横向きに回転させると、以下に示すようにスレッドが中断することです。

-(void)setOrientationView
{

    UIDevice *currentDevice = [UIDevice currentDevice];
    [currentDevice endGeneratingDeviceOrientationNotifications];
    UIDeviceOrientation theOr = currentDevice.orientation;

    if ( UIDeviceOrientationIsLandscape(theOr) && !isLandVisible )
    {
        NSLog(@"setLand");
        isLandVisible = YES;
        isPortVisible = NO;

        [self.window.rootViewController pushViewController:portCont animated:YES];   // <Thread 1: breakpoint 2.1

    }

    if( UIDeviceOrientationIsPortrait(theOr) && !isPortVisible )
    {
        NSLog(@"setPort");
        isPortVisible = YES;
        isLandVisible = NO;

        [self.window.rootViewController pushViewController:portCont animated:YES];

    }
    [currentDevice beginGeneratingDeviceOrientationNotifications];

}

ストーリーボードアプリを使用して、ロード時に両方の方向をサポートしようとして、ビューを表示した後にビューを閉じることなく、髪を引っ張っています(UIWebViewのリロードを防ぐために必要です)。ですから、私を超えた2つの問題があります。ありがとうSO。

4

1 に答える 1

0

iOSアプリプログラミングガイドの「高度なアプリの秘訣」セクションには、に関するガイドラインがいくつかLaunching in Landscape Modeあります。答えがこれらの数行以内にある可能性があります(可能な場合)。特にファイル内のに注意UIInterfaceOrientationしてください。Info.plist

于 2012-10-08T06:51:55.670 に答える