一些常用的宏定义
2014-08-13 14:19
281 查看
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
//屏幕的高度
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
//屏幕的宽度
//通过三色值获取颜色对象
#define rgb(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define ColorWithImgName(str) [UIColor colorWithPatternImage:[UIImage imageNamed:str]]
//设备型号
#define SystemVersionFloat [[UIDevice currentDevice].systemVersion floatValue]
//判断字符串是否为空
#define strIsEmpty(str) (str == nil || [str length]<1 ? YES : NO )
//取文件
#define mainBundle(fileName,fileType) [[NSBundle mainBundle] pathForResource:fileName ofType:fileType]
//设置字体
#define sysFont(f) [UIFont systemFontOfSize:f]
#define boldSysFont(f) [UIFont boldSystemFontOfSize:f]
//屏幕的高度
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
//屏幕的宽度
//通过三色值获取颜色对象
#define rgb(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define ColorWithImgName(str) [UIColor colorWithPatternImage:[UIImage imageNamed:str]]
//设备型号
#define SystemVersionFloat [[UIDevice currentDevice].systemVersion floatValue]
//判断字符串是否为空
#define strIsEmpty(str) (str == nil || [str length]<1 ? YES : NO )
//取文件
#define mainBundle(fileName,fileType) [[NSBundle mainBundle] pathForResource:fileName ofType:fileType]
//设置字体
#define sysFont(f) [UIFont systemFontOfSize:f]
#define boldSysFont(f) [UIFont boldSystemFontOfSize:f]
相关文章推荐
- 一些常用的宏定义
- 一些常用宏定义(转自HMT)
- 一些可以常用的宏定义
- 常用的一些宏定义
- 一些常用的宏定义(很有用,很有效噢)
- 一些常用的宏定义
- C语言百科一些成熟软件中常用的宏定义
- 位操作的一些常用宏定义
- iOS 一些常用的宏定义
- 一些常用的宏定义(很有帮助)
- [Cocos2d-x源码] 一些整数/字符串转换常用的宏定义
- 一些不常用但有用有意思的宏定义
- IOS开发中常用的一些宏定义
- 一些常用的宏定义
- iOS-为方便项目开发在pch添加一些常用宏定义
- pch文件的使用, 头文件使用, 常量(const)的定义,以及一些常用的宏定义
- Cocos2dx常用的一些宏定义和头文件
- 在oc中一些常用的宏定义总结
- Asp.NET中常用的一些优化性能的方法
- Oracle中一些常用的脚本[适用DBA]