Why is the iphone view size is set to 480
When I use interface builder i see that the size of the view is 480X300 why is that? isnt the iph开发者_开发问答one screen 960X640px?
These are actually "points". Depending on UIDevice
scale
parameter points convert to either 480*320 (for normal display) OR to 960*640 (for retina display).
You can also read the Apple docs which explains the difference between points and pixels in detail: Points Versus Pixels
And also note that the "missing 20 pixels" (300 instead of 320) are due to the status bar. If you select "status bar unspecified" in "simulated user interface elements" in the CMD-1 attributes inspector then you get the full 320 height.
Older iPhone (like iPhone 3GS) has 480x320 display, and iPhone 4 has 960x640 display (called retina display). On the retina display, any user interface elements will be scaled up to 2X. By the way, these are not "points", but just "pixels". If they were "points", iPhone 4 would be bigger than iPad.
To understand how to handle screen/display size depending on iPhone versions, read this article : Supporting High-Resolution screens
精彩评论