autolayout和xib作为tableview的header高度获取不对的解决方案

参考地址:
http://stackoverflow.com/questions/19005446/table-header-view-height-is-wrong-when-using-auto-layout-ib-and-font-sizes

关键代码:
UIView *baseHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,SCREEN_WIDTH , 250)];
self.headerView = [[[NSBundle mainBundle]loadNibNamed:@"HAIMineHeaderView" owner:nil options:nil] firstObject];
self.headerView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 250);
[baseHeaderView addSubview:self.headerView];
self.tableView.tableHeaderView = baseHeaderView;
self.tableView.tableFooterView = self.footerView;

你可能感兴趣的:(autolayout和xib作为tableview的header高度获取不对的解决方案)