QuintGao / GKNavigationBarViewController

iOS自定义导航栏-导航栏联动
https://www.jianshu.com/p/577755d0d69a
MIT License
727 stars 130 forks source link

隐藏导航栏分割线,home键返回主屏幕再打开,分割线会闪一下 #53

Closed Snail-hash closed 3 years ago

QuintGao commented 3 years ago

怎么设置的 我demo可以复现吗

Snail-hash commented 3 years ago

我给导航栏下面的view设置了部分圆角,我把下面的代码复制到GKWYMusicFriendViewController控制器重现了这个问题 self.gk_navTitleColor = HEXCOLOR(0x0C0C0C); self.gk_navTitleFont = [UIFont boldSystemFontOfSize:20]; self.gk_statusBarStyle = UIStatusBarStyleDefault; self.gk_statusBarHidden = NO; self.gk_navShadowColor = HEXCOLOR(0xE4E4E4); self.gk_navLineHidden = YES; self.gk_navBackgroundImage = [self imageWithColor:HEXCOLOR(0x4A9DF6)];

UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, [UIApplication sharedApplication].statusBarFrame.size.height + 44, self.view.frame.size.width, 100)];
view.backgroundColor = HEXCOLOR(0x4A9DF6);
[self.view addSubview:view];

UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:(UIRectCornerBottomLeft | UIRectCornerBottomRight) cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer* layer = [[CAShapeLayer alloc] init];
layer.frame = view.bounds;
layer.path = path.CGPath;
view.layer.mask = layer;
QuintGao commented 3 years ago

试了下应该是下面的view设置layer的问题,把layer去掉就正常了,或者把view的y值减1也可以。