ltebean / LTNavigationBar

UINavigationBar Category which allows you to change its appearance dynamically
MIT License
4.46k stars 677 forks source link

适配iPhone X的导航条显示不全 #73

Open huangwangxin opened 7 years ago

huangwangxin commented 7 years ago

今天在iPhone X模拟器上跑,导航栏显示不全。 在UINavigationBar+Awesome.m文件中31行改为如下: CGFloat height = [UIApplication sharedApplication].statusBarFrame.size.height; self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds) + height)];

这样改合适吗?

zzcshao commented 7 years ago

在iPhone X模拟器下运行的结果 (lldb) po self.bounds.size.height 44 (lldb) po [UIApplication sharedApplication].statusBarFrame.size.height 20 结果还是之前的64 , 求大神解释下.

huangwangxin commented 7 years ago

@zzcshao [UIApplication sharedApplication].statusBarFrame.size.height == 20的问题可能是你没有适配iPhone X,你要在Assets添加启动图,尺寸1125x2436像素。 这样子适配iPhone X,statusBarFrame.size.height的高度就为44像素了

Wangyixuan commented 7 years ago

@h1101723183 我提了一个新问题 请问适配iOS 11的时候 你遇到了么