zoukankan      html  css  js  c++  java
  • iOS开发各种机型尺寸判断

    //判断是否是ipad
    #define isPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
    //判断iPhone4系列
    #define kiPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
    //判断iPhone5系列
    #define kiPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
    //判断iPhone6系列
    #define kiPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
    //判断iphone6+系列
    #define kiPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
    //判断iPhoneX
    #define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
    //判断iPHoneXr
    #define IS_IPHONE_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
    //判断iPhoneXs
    #define IS_IPHONE_Xs ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
    //判断iPhoneXs Max
    #define IS_IPHONE_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && !isPad : NO)
     
    #define IS_IPHONE_X_orMore (IS_IPHONE_X==YES || IS_IPHONE_Xr== YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES)
    
  • 相关阅读:
    电商拼团系统开发思路和拼团系统开发产品设计思路
    唐古拉优选拼团系统设计模式和唐古拉优选拼团系统核心代码介绍
    计算机体系结构之三--函数的调用和返回【译】
    cxv文件合并
    ubuntu18.04安装Mono及MonoDevelop,用c#开发winform
    repo怎么都下不完,原因
    repo下载安卓源码经常掉线,解决方法
    编译ad10
    ub18.04 root账户
    安卓源码导入android studio
  • 原文地址:https://www.cnblogs.com/Crazy-ZY/p/10435265.html
Copyright © 2011-2022 走看看