//
// 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
本文提供了一个Objective-C类实现,用于获取iOS设备的屏幕宽度、高度等基本信息。通过调用UIKit框架中的UIScreen类,该实现能够准确获取到当前设备的应用可用宽度和高度。
89

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



