How do I limit an iOS app only to 4 inch screen devices?

后端 未结 3 711
眼角桃花
眼角桃花 2020-11-30 12:33

Is there a setting in Xcode that lets me declare that my app only supports 4\" screen devices (iPhone 5 and the newest iPod Touch)?

相关标签:
3条回答
  • 2020-11-30 12:53

    As you can see in below screenshot which is taken from Apple's official website, iPhone 4 and iPhone 4s are the ones with 3.5 inch screen and they do support iOS 7.

    enter image description here

    So you cannot constrain the app resolution support for 4 inch screen only by even using iOS 7.

    Also as per the below forum there is no way we can just put application on app store that only supports 4 inch screen iPhone.

    iPhone app for 4-inch screen only?

    Let me know if you need more help.

    0 讨论(0)
  • 2020-11-30 12:56

    Yes. You may not be able to add a setting in Xcode or a key for requiredDeviceCapabilities which allows you to make the app 4-inch only. But you can allow the user launch the application first, then in the very beginning view controller detect screen size by using following code:

    CGRect screenBound = [[UIScreen mainScreen] bounds];
    CGSize screenSize = screenBound.size;
    CGFloat screenWidth = screenSize.width;
    CGFloat screenHeight = screenSize.height;
    

    Last, based on the device screen size you preferred to run your app, you can either disable the next activity or continue.

    0 讨论(0)
  • Nope.

    Because iOS 7 supports devices with 3.5" screens, you can't use the only-support-iOS-x technique.

    Also, there isn't a setting in Xcode or a key for requiredDeviceCapabilities which allows you to make the app 4-inch only.

    0 讨论(0)
提交回复
热议问题