iphone:UIToolbar when set to tint color behaves differently on iOS 5 and ios6 simulator?

走远了吗. 提交于 2019-12-12 01:57:14

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!