Images for iphone 5 retina display

Here’s an except from my blog about this subject: [UIImage imageNamed:] automatically loads @2x versions of images when running on a retina device. Unfortunately, imageNamed: will NOT automatically load -568h@2x versions of images when running on an iPhone 5. Sometimes this doesn’t matter, for example icons and non-full screen graphics are probably the same on … Read more

How to programmatically get iOS status bar height

[UIApplication sharedApplication].statusBarFrame.size.height. But since all sizes are in points, not in pixels, status bar height always equals 20. Update. Seeing this answer being considered helpful, I should elaborate. Status bar height is, indeed, equals 20.0f points except following cases: status bar has been hidden with setStatusBarHidden:withAnimation: method and its height equals 0.0f points; as @Anton … Read more

iOS 5.1 with Xcode 4.2 and retina in iPad 3

@WrightCS’s answer handles the part about the images perfectly well. However, you can get the simulator and SDK to run on Snow Leopard. Download Xcode version 4.3.1 bypassing the AppStore from here http://developer.apple.com/downloads Open up the package and copy /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develop‌​er/SDKs/iPhoneOS5.1.sdk to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk Copy /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceS‌​upport/5.1 to /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1 (9B176 Copy /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/‌​Developer/SDKs/iPhoneSimulator5.1.sdk to /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1‌​.sdk Adapted from here. Edit: … Read more

How to simulate a retina display (HiDPI mode) in Mac OS X 10.8 Mountain Lion on a non-retina display?

Search for, download, and install Apple’s free Additional Tools for Xcode 8 (for previous Xcode releases search for Graphics Tools for Xcode according to your version). Note: free Apple Developer account required. Launch Quartz Debug application. Go to menu: Window —> UI Resolution. Check Enable HiDPI display modes. Quit Quartz Debug. Open System Preferences. Select … Read more

What is the best way to detect retina support on a device using JavaScript?

According to everything that I’ve read recently, browsers seem to be moving towards the resolution media query expression. This is instead of device-pixel-ratio that is being used in the currently accepted answer. The reason why device-pixel-ratio should only be used as a fallback is because it is not a standard media query. According to w3.org: … Read more

How to support both iPad and iPhone retina graphics in universal apps

I just created a test app and tested. So for devices without retina: ImageName.png – For iPhone/iPod ImageName~ipad.png — For iPad For devices with retina display: [email protected] – For iPhone/iPod ImageName@2x~ipad.png — For iPad And you can still use @2x if your iPhone high resolution image and iPad high resolution image have the same size. … Read more

Detect Retina Display

In order to detect the Retina display reliably on all iOS devices, you need to check if the device is running iOS4+ and if the [UIScreen mainScreen].scale property is equal to 2.0. You CANNOT assume a device is running iOS4+ if the scale property exists, as the iPad 3.2 also contains this property. On an … Read more

How to capture UIView to UIImage without loss of quality on retina display

Switch from use of UIGraphicsBeginImageContext to UIGraphicsBeginImageContextWithOptions (as documented on this page). Pass 0.0 for scale (the third argument) and you’ll get a context with a scale factor equal to that of the screen. UIGraphicsBeginImageContext uses a fixed scale factor of 1.0, so you’re actually getting exactly the same image on an iPhone 4 as … Read more