最近在优化代码。其中获取导航栏相关的公共方法进行了改进。
完全是为了更好的适配不同系统
原有的获取手机导航栏高度的方法:
// 屏幕宽度
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
// 屏幕高度
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
// 状态栏高度
#define kStatusBarHeight [UIApplication sharedApplication].statusBarFrame.size.height
// 导航栏高度
#define kNavigationHeight self.navigationController.navigationBar.frame.size.height
// 状态栏+导航栏总高度
#define KNavHeightAndStatusHeight self.navigationController.navigationBar.frame.size.height+[[UIApplication sharedApplication] statusBarFrame].size.height
// 底部tabbar高度

最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



