views:

57

answers:

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

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

A: 

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

Jesse Naugher
can i adjust the height on self.tableView.headerTableView? if not, how can I get a subview inside of it?
Sheehan Alam
headerTableView is not a property of a tableView
Sheehan Alam
A: 

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.

thelaws
+1  A: 

i need to call setHeaderView after defining the frame.

Sheehan Alam