Swift: fixed searchBar into tableView header

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-25 21:54:25

问题


I have a tableView with a searchBar inside the table header.

Everything is working well except when I scroll down the rows, the search bar disappear.

How can I make it fixed?


回答1:


There is no a way to maintain the header of a tableView fixed, but an useful approach when you need a unique header, could be to use UIViewController instead of UITableViewController, and set the header (UIView that contains searchBar) above the tableView.



来源:https://stackoverflow.com/questions/45147582/swift-fixed-searchbar-into-tableview-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!