UINavigationController设置透明背景

self.navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, NAV_BAR_HEIGHT)]; [self.navBar setBackgroundImage:[UIImage imageWithColor:[UIColor clearColor]] forBarMetrics:UIBarMetricsDefault]; [self.navBar setBackgroundColor:UIColorFromRGBA(0xFF1E1E1E)]; self.navBar.shadowImage = [[UIImage alloc] init];

使用UIImage+Color2Image.h将透明色值转换为图片, 设置shadowImage去掉底部line

评论

h
hw_7864

⭐️ Admin快速开发: https://show.cool-admin.com/

赞 0
h
hw_7864

⭐️ 官方文档: https://cool-js.com

赞 0
h
hw_7864

⭐️ chatgpt在线体验: https://cool-js.com/ai/chat-vip/index.html?r=helloworld

赞 0