1

OKay、これはおそらくかなり初心者ですが、私はそれを解決する方法を見つけることができませんでした。iPad UIViewControllerをストーリーボードにドラッグし、方向をYESに設定しました。しかし、何らかの理由で、そのビューは回転していません。上部のステータスバーは回転していますが、iPadを回転させたときに、内部のビュー、テーブルビュー、およびラベルは回転していません。誰もがそれを修正する理由と方法を知っていますか?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOr‌​ientation { return YES; } 
4

2 に答える 2

3
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations

    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        //return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
        if ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight)) {
           //implement your code 
        return (interfaceOrientation != UIInterfaceOrientationLandscapeRight);
    } else {

        return YES;
    }
}

お役に立てればと思います。

于 2012-05-24T12:44:18.687 に答える
2

ステータスバーが回転している場合は、確認するだけで、一部のモーダルセグエが適切に解除されなかった可能性があります。また、ナビゲーションコントローラにある場合は、スタック内のすべてのビューがYESを返すように設定されていることを確認してください。

于 2012-05-24T12:22:18.620 に答える