zoukankan      html  css  js  c++  java
  • 为了编程方便的效率宏定义的一些代码

    //Device

    #define isRetina            ([UIScreen mainScreen].scale > 1)

    //是否iphone5的分辨率

    #define isIphone5Screen     (CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(320, 568)))

    #define iPhone5             ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

    #define heightWithoutTab    (ScreenHeight - kTabbarHeight)

    #define ScreenHeight        (isIphone5Screen ? 568 : 480)

    #define heightList          (ScreenHeight - 20 - kTabbarHeight - kNavigationTopBarHeight)

    #define heightAdded         (isIphone5Screen ? 88 : 0)

    #define isSimulator         (NSNotFound != [[[UIDevice currentDevice] model] rangeOfString:@"Simulator"].location)

    #define isIphone            (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

    #define isIpad              (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

    //当前软件版本号

    #define currentVersionString [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]

    //for ipad

    #define kShouldReloadReadLaterButton            @"notification_reloadreadLater"

    #define kShouldReloadBookmarkButton             @"notification_reloadbookmark"

    #define kNotificationShouldReloadBookmarks      @"kNotificationShouldReloadBookmarks"

    #define kNavigationBarHeight 60

    #define kArticleDetailBackgroundColor       [UIColor colorWithRed:243.0f/255.0f green:241.0f/255.0f blue:243.0f/255.0f alpha:1]

    #define kListSlectedBackgroundColor         [UIColor colorWithRed:238.0f/255.0f green:238.0f/255.0f blue:238.0f/255.0f alpha:1]

    #define BS_COMMENT_TEXT_FONT_PAD[UIFont systemFontOfSize:22]

    #define ARTICLE_SUMMARY_TIME_TEXT_COLOR[UIColor grayColor]

    #define ARTICLE_SUMMARY_CONTENT_TEXT_COLOR[UIColor blackColor]

    #define SELECT_COLOR_PAD                    [UIColor colorWithRed:231.0/255.0 green:230.0/255.0 blue:231.0/255.0 alpha:1.0]

    #define ALL_TITLE_COLOR                     [UIFont boldSystemFontOfSize:22]

    #define kAllBackgroundColor                 [UIColor whiteColor]//[UIColor colorWithPatternImage:[UIImage imageNamed:@"首页总背景.png"]]

    // 偏好设置简写

    #define USERDEFAULT                         [NSUserDefaults standardUserDefaults]

    // 加载图片

    #define LOADBUNDLEIMAGE(PATH,TYPE)          [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:PATH ofType:TYPE]]

    // 设置ARBG

    #define COLOR_WITH_ARGB(R,G,B,A)            [UIColor colorWithRed:R / 255.0 green:G / 255.0 blue:B / 255.0 alpha:A]

    #define COLOR_WITH_RGB(R,G,B)               [UIColor colorWithRed:R / 255.0 green:G / 255.0 blue:B / 255.0 alpha:1]

    #define COLOR_WITH_IMAGENAME(imageName)     [UIColor colorWithPatternImage:[UIImage imageNamed:imageName]]

  • 相关阅读:
    Oracle通过Rman的"copy datafile"转移数据文件后不要使用sqlplus来重命名文件位置和文件名
    Oracle使用errorstack跟踪客户端的ORA报错
    Oracle OEM 13C表空间报警延迟问题
    CH5 用神经网络解决线性问题
    CH4 简化神经网络模型
    CH3 初识 TensorFlow
    Python 语言和 TensorFlow 框架环境准备
    创建型模式之单例模式与工厂模式(一)
    Node.js Koa框架学习笔记
    国庆七天假 不如来学学Vue-Router
  • 原文地址:https://www.cnblogs.com/leevaboo/p/2942263.html
Copyright © 2011-2022 走看看