美文网首页
适配尺寸

适配尺寸

作者: 失忆的程序员 | 来源:发表于2018-10-26 17:48 被阅读29次
    适配尺寸

    #define IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >=8.0? YES : NO)

    #define kScreenHeight [UIScreen mainScreen].bounds.size.height

    #define kScreenWidth [UIScreen mainScreen].bounds.size.width

    /** iphone 5/5c/5s */

    #define kW(R) R*(kScreenWidth) /320

    #define kH(R) R*(kScreenHeight) /568

    /** iphone 6 */

    #define W(R) R*(kScreenWidth) /375

    #define H(R) R*(kScreenHeight) /667

    #define SYSTEM_VERSION  [[UIDevice currentDevice].systemVersion floatValue]

    /** iPhone */

    #define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

    /** iPad */

    #define IS_PAD (UI_USER_INTERFACE_IDIOM()== UIUserInterfaceIdiomPad)

    /** 状态栏高度 */

    #define XPF_StatusBarHeight [[UIApplication sharedApplication] statusBarFrame].size.height

    /** NavBarHeight */

    #define XPF_NavBarHeight44.0

    /** 底部tabbar高度 */

    #define XPF_TabBarHeight ([[UIApplication sharedApplication] statusBarFrame].size.height >20?83:49)

    /** 整个导航栏高度 */

    #define XPF_TopHeight (XPF_StatusBarHeight + XPF_NavBarHeight)

    相关文章

      网友评论

          本文标题:适配尺寸

          本文链接:https://www.haomeiwen.com/subject/jreltqtx.html