iphone:UIToolbar设置为tint颜色在iOS 5和ios6模拟器上表现不同? [英] iphone:UIToolbar when set to tint color behaves differently on iOS 5 and ios6 simulator?

查看:113
本文介绍了iphone:UIToolbar设置为tint颜色在iOS 5和ios6模拟器上表现不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我将工具栏的颜色设置为淡色并在ios5模拟器上运行应用程序。它很好地显示了颜色。但是当我在ios6模拟器上运行相同的应用程序时,它会显示工具栏颜色模糊吗?

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.

推荐答案

我使用以下代码更改所有工具栏的色调和背景图像,并且它工作完美

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];
}

这篇关于iphone:UIToolbar设置为tint颜色在iOS 5和ios6模拟器上表现不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆