UIToolbar在ios 5.0和ios 6.0模拟器上显示不同的颜色 [英] UIToolbar shows different color on ios 5.0 and ios 6.0 Simulators
本文介绍了UIToolbar在ios 5.0和ios 6.0模拟器上显示不同的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我为UIToolBar设置了tintcolor,它在ios 6.0中正确显示,但在ios 5.0模拟器上显示黑色.我的代码在这里
I have set tintcolor for my UIToolBar.It displays Correctly in ios 6.0 but it shows black color on ios 5.0 simulator. My code is here
originalBounds = mysearchBarBarItem.customView.bounds;
mySearchBar.bounds = CGRectMake(0,0,215,44);
myTopToolbar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:NAVIGATION_BAR_BACKGROUND]];
myTopToolbar.barStyle = UIBarStyleDefault;
mySearchBar.barStyle = UIBarStyleDefault;
mySearchBar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:NAVIGATION_BAR_BACKGROUND]];
[myTopToolbar setItems:toolBarItemsArray animated:YES];
推荐答案
我不知道这是否可以有所作为,但是您可以尝试更改分配条形样式和颜色的顺序.试试:
I don't know if this can make a difference, but you could try to change the order in which you assign the style and color of the bar. Try:
myTopToolbar.barStyle = UIBarStyleDefault;
myTopToolbar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:NAVIGATION_BAR_BACKGROUND]];
更改tintcolor后分配样式可能会重置颜色.
It's possible that assigning the style after changing the tintcolor resets the color.
编辑
为什么这只会影响ios5而不会影响我不知道的ios6.
Why this would affect only ios5 and not ios6 I don't know.
这篇关于UIToolbar在ios 5.0和ios 6.0模拟器上显示不同的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文