// // CCUIScreen.m // CCFC // // Created by xichen on 11-12-16. // Copyright 2011年 ccteam. All rights reserved. // #import "CCUIScreen.h" @implementation UIScreen(cc) - (CGFloat)width { return [[UIScreen mainScreen] bounds].size.width; } - (CGFloat)height { return [[UIScreen mainScreen] bounds].size.height; } - (CGFloat)appWidth { return [[UIScreen mainScreen] applicationFrame].size.width; } - (CGFloat)appHeight { return [[UIScreen mainScreen] applicationFrame].size.height; } @end
可能有更新:
googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCUIScreen.m
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCUIScreen.m
本文介绍了CCUIScreen类的实现,该类提供了获取iOS设备屏幕宽度和高度的方法,包括整个屏幕和应用窗口的尺寸。代码使用Objective-C编写,并通过访问UIScreen的mainScreen属性来获取相关信息。

被折叠的 条评论
为什么被折叠?



