Fixed header to UITableview?

前端 未结 5 799
日久生厌
日久生厌 2020-12-01 09:46

I\'ve got a UITableView that I\'d like to stick a 44px subview on top of. I tried tableViewHeader, but that scrolls with the rest of the table.

5条回答
  •  感情败类
    2020-12-01 10:20

    Define a custom UIView in storyboard or xib, have a IBOutlet reference for that UIView in View Controller. In -(void)viewWillAppear:(BOOL)animated method write [self.tableView.superview addSubview:filterHeaderView];, here filterHeaderView is the IBOutlet reference for my header view which I want to add as fixed header in my tableview.

提交回复
热议问题