A UIScreen object contains the bounding rectangle of the device’s entire screen. When setting up your application’s user interface, you should use the properties of this object to get the recommended frame rectangles for your application’s window.
UIScreen对象包含了整个屏幕的边界矩形。当构造应用的用户界面接口时,你应该使用该对象的属性来获得推荐的矩形大小,用以构造你的程序窗口。
以下列出的属性和操作是我用过的。
+ mainScreen Returns the screen object representing the device’s screen.
bounds property Contains the bounding rectangle of the screen, measured in points. (read-only)
scale property The natural scale factor associated with the screen. (read-only)
CGRect bound = [[UIScreen mainScreen] bounds]; // 返回的是带有状态栏的Rect
float scale = [[UIScreenmainScreen] scale]; // 得到设备的自然分辨率
网友评论