问题
I want my app to run on Retina devices only. How do i disable supporting non-Retina iPhone? Is that possible?
回答1:
As the screen size is same for iPhone 3G, 3Gs, 4, 4S; You won't be able to find out which one is retina display among them (AFAIK). But, from iPhone4 the device is having front facing camera, so, You can use that. You can have your App require front-facing camera (Just an example; there are other hardwares too, newly introduced from iPhone4) device capability.
These are specified in the plist file for the app using the UIRequiredDeviceCapabilities
key.
A front-facing camera, that would limit it to those devices that have that, eliminating the 3G and 3GS (They are Non-retina displays).
For more details UIRequiredDeviceCapabilities
回答2:
It may work! A hacky way!
You need two images temp.png and temp@2x.png
In your first view controller take a UIButton
hidden from view, set background image of it --- temp.png, when your viewDidLoad
called, that will set the background image for that button, after that, you can check with if([buttonObject currentBackgroundImage] == [UIImage imageNamed:@"temp@2x.png"])
then its a retina
support device, you may show some message to user, or do whatever you want to!
来源:https://stackoverflow.com/questions/15779320/how-to-prevent-iphone-app-from-running-on-non-retina-device