ios - HeaderFooterView of UITableView not stretching according to size class width -


i have tableview custom header make nib file.

the size class of nib file x any, width of header not stretch fit on iphone 6 & iphone 6plus.

here's how make headerfooterview

let headercell = uinib(nibname: "teamcheckheadertableviewcell", bundle: nil) tblteamcheck.registernib(headercell, forheaderfooterviewreuseidentifier: teamcheckheadertableviewcell.description()) 

in viewforheaderinsection

func tableview(tableview: uitableview, viewforheaderinsection section: int) -> uiview? {      let headercell = tblteamcheck.dequeuereusableheaderfooterviewwithidentifier(teamcheckheadertableviewcell.description()) as! teamcheckheadertableviewcell      return headercell } 

here's how looks on iphone 5

enter image description here

here's how looks on iphone 6

enter image description here

the same 6plus, seems width of headerfooterview constant 320.

try add headercell.layoutifneeded() func tableview(tableview: uitableview, viewforheaderinsection section: int) -> uiview?


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -