Swift: fixed searchBar into tableView header

2019-08-16 18:27发布

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条回答
成全新的幸福
2楼-- · 2019-08-16 19:22

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.

查看更多
登录 后发表回答