我想在iOS7中设置工具栏的背景颜色:我用这个设置颜色:
toolBar= [[UIToolbar alloc] initWithFrame:CGRectMake(0,0,320,40)]; [toolBar setBarStyle:UIBarStyleBlack]; toolBar.items = [[NSArray alloc] initWithObjects:barButtonDone,flexible,barButtonOther,nil]; toolBar.tintColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"dropdownbar"]];
但是背景图像没有显示.
我想知道这是做什么的:
NSArray *ver = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."]; if ([[ver objectAtIndex:0] intValue] >= 7) { self.navigationController.navigationBar.barTintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"top_bar"]]; self.navigationController.navigationBar.translucent = NO; } else { self.navigationController.navigationBar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"top_bar"]]; }
Nd如何更改默认导航栏的后退按钮颜色: