Open langhua9527 opened 8 years ago
`- (void)lt_setBackgroundColor:(UIColor *)backgroundColor { if (!self.overlay) { [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -20, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 20)]; self.overlay.userInteractionEnabled = NO; self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; }
self.overlay.backgroundColor = backgroundColor;
dispatch_async(dispatch_get_main_queue(), ^{
[self insertSubview:self.overlay atIndex:0];
});
}`
just try it , i fix it
- (void)lt_setBackgroundColor:(UIColor *)backgroundColor
{
if (!self.overlay) {
[self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -20, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 20)];
self.overlay.userInteractionEnabled = NO;
self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
}
self.overlay.backgroundColor = backgroundColor;
dispatch_async(dispatch_get_main_queue(), ^{
[self insertSubview:self.overlay atIndex:0];
});
}
楼上的这个方法亲测可以解决,我iOS10.2系统 xcode8.2跑的
把这个文件UINavigationBar+Awesome.h 里面的方法lt_setBackgroundColor 改成这样就解决了
因为返回回来之后self.overlay就跑最上面一层去了,并没有在最后面,所以就挡到了,显示不出来了 每次这样手动处理一下就好了