我想设置工具栏的背景色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"]];
}
钕怎么改回默认的导航栏上的按钮颜色:
工具栏或导航栏他们是两个完全不同的事情。导航栏在顶部通常位于底部。 – Popeye
@Popeye我知道那..但我想知道那代码会做什么? – vivek
我其实在谈论你的形象。如果这是在顶部,它应该是一个导航栏而不是一个工具栏。 – Popeye