A header View is set to a tableView
and the header View is an xib file using auto layout. 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 the right headerview height
Asked
Active
Viewed 117 times
0
-
Can you show screenshot of your problem – Nirav D Jun 20 '16 at 07:14
-
Show me your heightForRowAtIndexPath method .. ? – Balaji Ramakrishnan Jun 20 '16 at 07:15
-
@NiravDoctorwala Hi,I have uploaded two pic links ,pls check .thank you ! – Yung Jun 20 '16 at 07:37
-
@BalajiRamakrishnan Hi -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return [_messageTableViewCell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height+1; } – Yung Jun 20 '16 at 07:38
2 Answers
0
or add in programming to disable the insets
self.automaticallyAdjustsScrollViewInsets = false
or if you are using navigation controller
self.navigationController.automaticallyAdjustsScrollViewInsets = false

Sucharu Hasija
- 1,096
- 11
- 23
-
Thank you !I have tried this ,but it does't work and I have uploaded two screenshots . – Yung Jun 20 '16 at 07:40
-
I had also faced similar problem for tableview. But i have solved by untick this bool. – Sucharu Hasija Jun 20 '16 at 08:04
0
Just change your viewWill appear like this
- (void)viewWillAppear:(BOOL)animated {
self.navigationController.navigationBar.translucent = NO;
}
Hope this will help you.

Nirav D
- 71,513
- 12
- 161
- 183
-
wow!!!!!Thank you so much !It did works.I use the second line.Thank you again .This helps a lot. – Yung Jun 20 '16 at 09:40