简体   繁体   English

更改UITableViewController背景色

[英]Change UITableViewController background color

I was implementing search in a UITableViewController , so i read a lot of tutorials and they said to implement UISearchController . 我当时在UITableViewController实现搜索,所以我读了很多教程,他们说要实现UISearchController

For this i have taken a UITableViewController and embedded in a UINavigation​Controller then i assign UISearchController.searchBar to tableHeaderView . 为此,我使用了UITableViewController并将其嵌入UINavigation​Controller然后将UISearchController.searchBar分配给tableHeaderView Search is working and everything is perfect. 搜索有效,一切都完美无缺。

But when i scroll down searchBar scrolls down leaving a blank space which has different color then my tableview color. 但是,当我向下滚动searchBar向下滚动时,留下一个空白,其颜色与我的tableview颜色不同。

How can i change it. 我该如何更改。 I am unable to do so yet. 我还不能这样做。 看色差

Simple to implement way is use uiviewcobtroller put searchbar on top and below that put simple tableview now you can solved ur problem .... dont put searchbar in tableview. 简单实现的方法是使用uiviewcobtroller将searchbar放在放置简单tableview的顶部和下方,现在您可以解决您的问题....不要将searchbar放置在tableview中。 Hope u will resolve it .. cheers Thanks 希望你能解决它..欢呼谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM