开发者

How to ensure Search bar sticks to the top in iPhone SDK?

开发者 https://www.devze.com 2023-02-12 00:33 出处:网络
I have a table view along with search bar. I want to ensure that while scrolling the tableview, the searchbar stays on top -开发者_如何学运维 always.

I have a table view along with search bar.

I want to ensure that while scrolling the tableview, the searchbar stays on top -开发者_如何学运维 always.

How can this be achieved?


I suggest you to Keep both of them separated.


You have to return your search bar in the table's delegate callback

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section

Note: don't forget to implement tableView:heightForHeaderInSection:

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号