iOS Development: How can I prevent an iPad from running a universal app in iPad mode?

前端 未结 9 1351
死守一世寂寞
死守一世寂寞 2020-12-31 04:50

I\'m diving into iOS development and I created a universal app that turned into an iPhone-only app. When it runs on the iPad, it just loads a white screen since there\'s no

9条回答
  •  孤独总比滥情好
    2020-12-31 05:21

    You should NOT add this to your Info.plist file. Instead, add it to your build settings per Apple's suggestion. Specifically, use the TARGETED_DEVICE_FAMILY build setting.

    If you are using storyboards, you also want to remove the UIMainStoryboardFile~ipad key from your Info.plist as it will be used regardless of your TARGETED_DEVICE_FAMILY setting.

    Good luck!

提交回复
热议问题