美文网首页
autolayout和xib作为tableview的header

autolayout和xib作为tableview的header

作者: NS西北风 | 来源:发表于2016-02-24 09:24 被阅读1263次

    参考地址:
    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

          本文链接:https://www.haomeiwen.com/subject/dmqikttx.html