Yung Yung - 1 year ago 71
iOS Question

tableHeaderView' height is changed automatically after pushing a new viewcontrolller and come back

A header View is set to a tableView and the header View is an xib file using autolayout.When clicking a tableView cell and push another tableViewController ,then click back button to pop the tableViewController.However the headerView's height is changed from 98 to 34 and there is a gap between the headerView and the first cell.This is really odd.Is there anybody know how to solve this problem?Thank you very much!
pic with problem
pic with the right headerview height

Answer Source

Just change your viewWill appear like this

- (void)viewWillAppear:(BOOL)animated {
     self.navigationController.navigationBar.translucent = NO;

Hope this will help you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download