如何在 iOS7 中更改 UISearchBar 的背景颜色 [英] How to change background color of UISearchBar in iOS7
本文介绍了如何在 iOS7 中更改 UISearchBar 的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在 iOS7 中更改 UISearchBar 的背景颜色?
How to change background color of UISearchBar in iOS7?
不是灰色,我想像我的 uinavigationbar 一样改变颜色
not gray, I want to change color like my uinavigationbar
如果我使用这个代码,那就是结果
if I Use this code, that's what comes out
searchBar.backgroundColor = [UIColor redColor];
那不是红色!!!这与导航栏的背景颜色完全相同.
That is not red color!!! This exact same situation as in background color of navigation bar.
推荐答案
需要使用:
searchBar.barTintColor = [UIColor redColor];
谢谢!
这篇关于如何在 iOS7 中更改 UISearchBar 的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文