IOS开发中常用的 宏命令整理
来源:互联网 发布:2016网络歌曲合集下载 编辑:程序博客网 时间:2024/04/30 03:11
// 版本判断
#define iOS7 SystemVersion >= 7
// 加载图片
#define LoadImage(PATH,TYPE) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:PATH ofType:TYPE]]
// 创建TabBar集合
#define CREATE_TABARITEM(TITLE,PATH,TAG) [[[UITabBarItem alloc] initWithTitle:TITLE image:PATH tag:TAG] autorelease]
// 创建导航视图控制器
#define Create_Navigation(CONTROLLER) [[UINavigationController alloc] initWithRootViewController:CONTROLLER]
// 设置ARBG
#define ARGB(R,G,B,A) [UIColor colorWithRed:R / 255.0 green:G / 255.0 blue:B / 255.0 alpha:A]
// 清空颜色
#define CLEARCOLOR [UIColor clearColor]
// 设置图像为填充色
#define ImageColor(PATH,TYPE) [UIColor colorWithPatternImage:LoadImage(PATH,TYPE)]
// 设置字体大小
#define FONT_WITH_SIZE(SIZE) [UIFont systemFontOfSize:SIZE]
// 创建导航条自定义按钮
#define CUSTOMVIEW(VIEW) [[UIBarButtonItem alloc] initWithCustomView:VIEW]
// 角度旋转
#define DegressToRadian(x) (M_PI * (x) / 180.0)
// AppDelegate
#define ApplicationDelegate (AppDelegate *)[[UIApplication sharedApplication] delegate]
// MainBundleKey
#define ObjectForBundleKey(Key) [[NSBundle mainBundle] objectForInfoDictionaryKey:Key]
// 屏幕宽度
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
// 屏幕高度
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
// 判断是否为iPhone5
#define iPhone5 ScreenHeight > 480
// 加载文件来自Bundle
#define FileForBundle(PATH, TYPE) [[NSBundle mainBundle] pathForResource:PATH ofType:TYPE]
// 项目主体颜色
#define MainColor [UIColor whiteColor]
// 系统版本
#define SystemVersion [[[UIDevice currentDevice] systemVersion] floatValue]
#define iOS7 SystemVersion >= 7
// 加载图片
#define LoadImage(PATH,TYPE) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:PATH ofType:TYPE]]
// 创建TabBar集合
#define CREATE_TABARITEM(TITLE,PATH,TAG) [[[UITabBarItem alloc] initWithTitle:TITLE image:PATH tag:TAG] autorelease]
// 创建导航视图控制器
#define Create_Navigation(CONTROLLER) [[UINavigationController alloc] initWithRootViewController:CONTROLLER]
// 设置ARBG
#define ARGB(R,G,B,A) [UIColor colorWithRed:R / 255.0 green:G / 255.0 blue:B / 255.0 alpha:A]
// 清空颜色
#define CLEARCOLOR [UIColor clearColor]
// 设置图像为填充色
#define ImageColor(PATH,TYPE) [UIColor colorWithPatternImage:LoadImage(PATH,TYPE)]
// 设置字体大小
#define FONT_WITH_SIZE(SIZE) [UIFont systemFontOfSize:SIZE]
// 创建导航条自定义按钮
#define CUSTOMVIEW(VIEW) [[UIBarButtonItem alloc] initWithCustomView:VIEW]
// 角度旋转
#define DegressToRadian(x) (M_PI * (x) / 180.0)
// AppDelegate
#define ApplicationDelegate (AppDelegate *)[[UIApplication sharedApplication] delegate]
// MainBundleKey
#define ObjectForBundleKey(Key) [[NSBundle mainBundle] objectForInfoDictionaryKey:Key]
// 屏幕宽度
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
// 屏幕高度
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
// 判断是否为iPhone5
#define iPhone5 ScreenHeight > 480
// 加载文件来自Bundle
#define FileForBundle(PATH, TYPE) [[NSBundle mainBundle] pathForResource:PATH ofType:TYPE]
// 项目主体颜色
#define MainColor [UIColor whiteColor]
// 系统版本
#define SystemVersion [[[UIDevice currentDevice] systemVersion] floatValue]
0 0
- IOS开发中常用的 宏命令整理
- Java开发中最常用的Linux命令整理
- V3S开发中自己常用的命令整理
- iOS开发中常用第三方库的整理
- iOS 开发中常用的第三方下载地址整理
- iOS开发中常用第三方库的整理
- iOS开发中常用第三方库的整理
- 开发常用linux命令(整理中...)
- iOS开发中 常用代码整理
- Android开发常用的adb命令整理
- Android开发常用的adb命令整理
- Android开发常用的adb命令整理
- iOS开发- 项目中常用的svn命令
- iOS开发常用宏整理分享
- ios开发中常用的宏
- IOS开发中常用的宏定义
- iOS 开发中常用的一些宏
- iOS 开发中常用的宏定义
- JAVA常用的util工具类
- RecyclerView,SwipeRefreshLayout,CardView最新控件的使用
- (转)android 小知识
- 家装旺季莫错过 熟记墙面装修流程
- 第6周项目-程序阅读5
- IOS开发中常用的 宏命令整理
- BZoj 1293 生日礼物(小顶堆)
- IE,FF下getElementsByName无效
- 获取指定目录下的文件名列表
- Add Binary
- Android获取手机号码
- Android中多次点击控件问题
- Aspose.Cells Excel删除行
- Hybird APP 开发 总结