1

次の方法で、iPad/iPhone シミュレーターの向きを簡単に変更できます: ハードウェア -> 左または右に回転します。しかし、どうすればiDevice(iPadデバイスまたはiPhoneデバイス?)でそれを変更できますか?

誰か助けてください。

コードを追加する必要がありますか? ここに画像の説明を入力

4

4 に答える 4

1

概要タブに移動し、下にスクロールして「iPad 展開情報」に移動します。「Supported Interface Orientations」の 4 つのオプションをすべて選択解除します。次に、もう一度選択しますが、最初に [縦] を選択し、その後に残ります。

ここに画像の説明を入力

また、縦向きモードになると予想されるビューで、追加するだけです

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation
{
    return (orientation == UIInterfaceOrientationMaskAll);
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationPortrait;
}

お役に立てれば。

于 2013-05-27T08:54:01.917 に答える
0

Initial interface orientationキー/値を$appName-info.plistファイルに追加する

app-info.plist

于 2013-05-27T09:05:28.927 に答える
0

サポート ファイルの .plist ファイルに移動します。

そこに、サポートされているインターフェイスの向きが表示されます 下のキーを追加

Item 0 String Portrait (top home button)
Item 1 String Portrait (bottom home button)
Item 2 String Landscape (left home button)
Item 3 String Landscape (right home button)

ここに画像の説明を入力

于 2013-05-27T08:29:24.557 に答える