2014-10-03 48 views
1

我正在创建一个应用程序,我想要在IOS中的音乐应用程序中使用相同的searchBar颜色。我想知道如何更改searchBar的字段,我已经为此搜索了周围,但找不到任何有用的东西。这里是一个图像更改搜索栏中的字段背景

enter image description here

+0

退房这个http://stackoverflow.com/questions/13817330/how-to-change-inside-background-color-of -uisearchbar-component-on-ios – 2014-10-03 16:54:14

+0

这怎么能用swift来完成? – 2014-10-03 16:56:34

回答

0

试试这个:

var textField = searchBar.valueForKey("searchField") as UITextField 
textField.backgroundColor = UIColor.redColor() 
+0

这是不是访问私人API? – Allreadyhome 2015-08-13 10:16:36