Search code examples
objective-ciosframecgrect

iOS - Frame Height not by Pixel?


I just had a question about the Frame Height.

frame.size.height = 450;

When I set a CGRect frame with height of 450 when the x= 0 and y = 0. The tableview extends almost all the way to the bottom. IS the number not based on pixels since I am testing it on an iPhone 5, the 1136. It shouldn't even have extended half way.

Thanks!


Solution

  • iOS screen coordinates are in UI points. One point is one pixel on the original-density screens, and one point is thus two pixels on the high resolution/retina displays.

    Update from 2014: One point is even three pixels on the iPhone 6 Plus. (2018: and iPhone 6s Plus, 7 Plus, 8 Plus and X.)