Xcode11でiPadの画面回転設定を行う
iOSアプリを新たに横画面に対応させようとした時にハマったのでメモ。
問題点
通常、画面回転を行いたい場合はTargetのGeneralタブの「Device Orientation」部分のチェックボックスで設定を行うのだが、ここでの設定変更はiPadでは反映されない。(特にエラーメッセージも出ないので、ユーザーのレビューで指摘されるまで気付けなかった…)
解決策
Info.plist を直接編集する。
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
//ここに追記
</array>
終わりに
Info.plistが自動で追記されないのは仕様なのか不具合なのか…?
自分の見落としがあるかもしれないので、もっと簡単な解決方法があればコメントで教えていただけると助かります。
Author And Source
この問題について(Xcode11でiPadの画面回転設定を行う), 我々は、より多くの情報をここで見つけました https://qiita.com/ke-ta/items/aee23a45e386efdff438著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .