iOS:屏幕顶部、底部的高度)

判断是否是iPad

#define ISIPAD         [[UIDevice currentDevice] userInterfaceIdiom] ==UIUserInterfaceIdiomPad

判断手机型号为X

#define is_IPHONEX                          [[UIScreen mainScreen] bounds].size.width == 375.0f &&([[UIScreen mainScreen] bounds].size.height == 812.0f)

获取状态栏的高度 iPhone X - 44pt 其他20pt

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

获取导航栏的高度 - (不包含状态栏高度) 44pt

#define NavigationBarHeight                 self.navigationController.navigationBar.frame.size.height

屏幕底部 tabBar高度49pt + 安全视图高度34pt(iPhone X)

#define TabbarHeight                        self.tabBarController.tabBar.frame.size.height

屏幕顶部 导航栏高度(包含状态栏高度)

#define NavigationHeight                    (StatusBarHeight + NavigationBarHeight)

屏幕底部安全视图高度 - 适配iPhone X底部

#define TOOLH                               (is_IPHONEX ? 34 : 0)

屏幕底部 toolbar高度 + 安全视图高度34pt

#define ToolbarHeight                       self.navigationController.toolbar.frame.size.height

版权声明:本文为qq_15289761原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。