UINavigationController设置透明背景

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

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

转载于:https://my.oschina.net/redhouse/blog/468573

你可能感兴趣的:(UINavigationController设置透明背景)