iOS獲取的寬高都默認(rèn)是point。 但是有時(shí)候我們想獲取具體的像素,當(dāng)然我們可以用point 乘以倍數(shù)。
不過(guò)獲取屏幕的像素有更簡(jiǎn)單的方法:
[[UIScreen mainScreen] currentMode]
UIScreenMode:只有兩個(gè)僅讀屬性
@property(readonly,nonatomic) CGSize size;
// The width and height in pixels
@property(readonly,nonatomic) CGFloat pixelAspectRatio;
// The aspect ratio of a single pixel. The ratio is defined as X/Y.