UITableView tableViewHeader background clipped

I have a custom view that I am trying to load into tableViewHeader. It is strange that the bottom of the background is always cropped. It is as if the navigation bar had pressed the buttons down, but not the rest of the view.

The pin is as follows:

Nib image

I configure it this way in my tableview controller:

[[NSBundle mainBundle] loadNibNamed:@"MenuNav" owner:self options:nil];
[self.tableView setTableHeaderView:headerView];

This is how it looks in the simulator. Buttons also do not handle clicks in the lower half.

Image in Simulator

What I tried: -preparing the front-line:

[self.tableView bringSubviewToFront:headerView];

-setting need a layout to view the table:

[self.tableView setNeedsLayout]

- I also checked the correctness of the presentation framework.

Any ideas? thank!

Edit

I found a criminal. I had to uncheck the Autoresize Subviews checkbox in IB: http://i.imgur.com/jH2bs.png

+3
source share
2

, :

  • (UIView *) tableView: (UITableView *) tableView viewForHeaderInSection: (NSInteger) ;

, , :

- (CGFloat) tableView: (UITableView *) tableView heightForHeaderInSection: (NSInteger) ;

+1

autoresizingMask ? - :

headerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
0

All Articles