IPhone and iPad screen resolution

I am developing a universal application. I want to know if the screen resolutions (320 * 480) for iphone and (768 * 1024) in iPad will work for all iphone (iPhone 3G, iPhone4, etc.) and all iPad. Because based on these screen resolutions. I set textField, the UILabel width on both iPhone and iPad. Will these work for the retina and nonretinas?

+5
source share
3 answers

iPhone and iPads Retina use the same coordinate system as non-retina devices. Currently, all iPads have a 768x1024 logical coordinate space, and all iPhones, except the iPhone 5, have a 320x480 logical coordinate space. Your code should work well on Retina and Non-Retina devices.

iPhone 5 , iOS, , Default.png .

[[UIScreen mainScreen] bounds]. Retina Retina. Retina, [[UIScreen mainScreen] scale]; - (1.0 Retina, 2.0 Retina).

+15

UIKit CoreGraphics , .

, . , .

, , UILabel .

Apple:

In iOS, all coordinate values and distances are specified using floating-point values in units referred to as points. The measurable size of a point varies from device to device and is largely irrelevant. The main thing to understand about points is that they provide a fixed frame of reference for drawing.

" " : http://developer.apple.com/library/ios/documentation/windowsviews/conceptual/viewpg_iphoneos/WindowsandViews/WindowsandViews.html#//apple_ref/doc/uid/TP40009503-CH2-SW15

+1

You can always use the opportunities to get the OS and do what you need for your interface.

var pattern:RegExp = /iphone5/i; 
var str:String = Capabilities.os; 

if (str.search(pattern)==0)
{
    trace('iPhone5 Detected. Alter height.');
}else{
   trace('No need to change dimensions if developing at 960x640');
}
-1
source

All Articles