Sheehan Alam
Sheehan Alam

Reputation: 60869

How can I resize a UITableView header?

self.headerView.frame = CGRectMake(0, 0, 320, 167); //this is a UIView

doesnt seem to do anything. everything is hooked up in IB.

Upvotes: 0

Views: 1089

Answers (3)

Sheehan Alam
Sheehan Alam

Reputation: 60869

i need to call setHeaderView after defining the frame.

Upvotes: 2

thelaws
thelaws

Reputation: 8001

Try the UITableViewDelegate's -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section method.

Also, the -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section might also be of interest to you if you're trying to put a custom view as a header.

Upvotes: 0

Jesse Naugher
Jesse Naugher

Reputation: 9820

is this in a UITableViewController? if so, try accessing the tableHeaderView (self.tableView.headerTableView) and then getting the subview you want.

Upvotes: 0

Related Questions