// 取出appearance对象
UINavigationBar *navBar = [UINavigationBar appearance];
// 设置tintColor
[navBar setTintColor:[UIColor blackColor]];
// 导航栏显示成clearColor
UIImage *image = [UIImage imageWithFillColor:[UIColor clearColor] size:CGSizeMake(MAIN_SCR_W, 64)];
[navBar setBackgroundColor:[UIColor clearColor]];
[navBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
// 去掉导航栏下面那条线
[navBar setShadowImage:[[UIImage alloc] init]];
iOS 导航栏设置
最新推荐文章于 2020-07-13 02:33:58 发布