Running a universal app as a scaled iPhone app?

后端 未结 2 920
梦如初夏
梦如初夏 2021-01-25 14:04

I\'ve seen tons of questions and answers regarding merging an iPhone and an iPad app into an universal app, but that isn\'t what I want to do. What I am going to do is use in ap

2条回答
  •  既然无缘
    2021-01-25 14:34

    The Info.plist file in an iOS app contains a key, UIDeviceFamily, which lists the devices that the app natively supports. If the key's value is 1, or a array containing 1, the app natively supports iPhones and iPods Touch. If the value is 2, or a array containing 2, the app natively supports iPads.

    If UIDeviceFamily says the app supports iPads, then it will run the app in native iPad mode, not in iPhone-wrapper mode.

    The Info.plist file is part of your app bundle, and you can't modify files in the app bundle.

    So there is no way to enable or disable the system's native-iPad support at runtime. You'll have to move your app's top-level view into a wrapper view that centers and scales its child, and use that wrapper view as the UIWindow's subview.

    UIDeviceFamily in the Information Property List Key Reference

提交回复
热议问题