原因:苹果对导航栏的性能做了优化,默认情况下,如果导航栏与视图没有折叠,导航栏的背景透明,如果系统检测到有重叠的话,会变成毛玻璃的效果
解决方案:
if (@available(iOS 15.0, *)) {
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init];
[appearancesetShadowImage:[[UIImage alloc] init]];
[appearancesetBackgroundColor:[UIColor whiteColor]];
[appearancesetBackgroundImage:[UIImage imageWithColor:[UIColor whiteColor]]];
[appearancesetShadowImage:[UIImage imageWithColor:[UIColor whiteColor]]];
[[UINavigationBar appearance] setScrollEdgeAppearance: appearance];
}
网友评论