if(@available(ios 15.0,*)){
UINavigationBarAppearance *appearance = [UINavigationBarAppearance new];
[appearance configureWithOpaqueBackground];
appearance.backgroundColor = [UIColor whiteColor];
appearance.shadowColor = [UIColor clearColor];
self.navigationBar.standardAppearance = appearance;
self.navigationBar.scrollEdgeAppearance=self.navigationBar.standardAppearance;
}
添加上面这段代码就可以实现去除透明变化的影响.去除导航栏下面的黑线.
appearance.shadowColor = [UIColor clearColor];
网友评论