问题
If I set the color of toolbar as tint color and run the application on ios5 simulator. It shows the color well. But when I run the same application on ios6 simulator, it show the toolbar color blurred?
Please tell me how to resolve this issue.
回答1:
i use the following code to change tint coor and background image of all toolbars and it workds perfect
UIToolbar *dummyToolbar = [[UIToolbar alloc] init];
if ([dummyToolbar respondsToSelector:@selector(setBackgroundImage:forToolbarPosition:barMetrics:)]) {
[[UIToolbar appearance] setTintColor:kNAvigationColorTitleColor];
UIImage *aImage = [[UIImage imageNamed:@"navigationBarBackGround.png"] stretchableImageWithLeftCapWidth:6 topCapHeight:6];
[[UIToolbar appearance] setBackgroundImage:aImage forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
}
来源:https://stackoverflow.com/questions/12833628/iphoneuitoolbar-when-set-to-tint-color-behaves-differently-on-ios-5-and-ios6-si