次の方法で、iPad/iPhone シミュレーターの向きを簡単に変更できます: ハードウェア -> 左または右に回転します。しかし、どうすればiDevice(iPadデバイスまたはiPhoneデバイス?)でそれを変更できますか?
誰か助けてください。
コードを追加する必要がありますか?
次の方法で、iPad/iPhone シミュレーターの向きを簡単に変更できます: ハードウェア -> 左または右に回転します。しかし、どうすればiDevice(iPadデバイスまたはiPhoneデバイス?)でそれを変更できますか?
誰か助けてください。
コードを追加する必要がありますか?
概要タブに移動し、下にスクロールして「iPad 展開情報」に移動します。「Supported Interface Orientations」の 4 つのオプションをすべて選択解除します。次に、もう一度選択しますが、最初に [縦] を選択し、その後に残ります。
また、縦向きモードになると予想されるビューで、追加するだけです
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation
{
return (orientation == UIInterfaceOrientationMaskAll);
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}
お役に立てれば。
Initial interface orientation
キー/値を$appName-info.plist
ファイルに追加する
サポート ファイルの .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)