user3527777
user3527777

Reputation: 135

How can I make my header sticky to tableView?

I create header with

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

and set it height with

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

I have one header and one section.

I create VC in code inherited from UITableViewController I use UITableViewStyleGrouped

but then I scroll down header is disappear

Upvotes: 0

Views: 1821

Answers (1)

chrisblomm
chrisblomm

Reputation: 314

You should use the Plain tableViewStyle. See here

    self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];

Upvotes: 1

Related Questions