0

わかりましたので、3 つのビューをすべて横向きにしたいのですが、そのうちの 2 つを横向きにし、そのうちの 1 つだけを縦向きにしたいのです。私がこれを行うと、それらはすべて縦向きになります。ストーリーボードを使用しています。

私は.mファイルに持っています:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeLeft)
        return YES;

    return NO;
}

ターゲットで横向きのままに設定し、plist には「初期インターフェイスの向き」と「サポートされている横向きの向き」があります。私はすべてを試しましたが、何もうまくいきませんでした。誰か助けてください。

4

1 に答える 1

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

}

これを、ランドスケープ モードにしたい各ビュー コントローラーに追加します。これがあなたを助けることを願っています。

于 2012-09-12T12:50:29.693 に答える