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

here's how looks on iphone 6

the same 6plus, seems width of headerfooterview constant 320.
try add headercell.layoutifneeded() func tableview(tableview: uitableview, viewforheaderinsection section: int) -> uiview?
Comments
Post a Comment