ios - why do my constraints make the layout different while running app on iphone 5 and iphone 6? -
i designing swift app shows photo, map , content - of in uitableview header.
when run app on iphone 5, looks this:
the yellow field text view has following constraints:
and:
this looks fine on iphone 5. however, when run on iphone 6, see:
i don't understand why 2 views differ.
now, in code, in viewdidload() have call method:
defineheaderview() that populates header view data (e.g. fills username, text, photo).
i have block of code:
override func viewdidlayoutsubviews() { super.viewdidlayoutsubviews() sizeheadertofit() } func sizeheadertofit() { let headerview = mytable.tableheaderview! headerview.setneedslayout() headerview.layoutifneeded() let height = headerview.systemlayoutsizefitting(uilayoutfittingcompressedsize).height var frame = headerview.frame frame.size.height = height headerview.frame = frame mytable.tableheaderview = headerview } in storyboard define headerview view inside uitableview:
can explain me why view differ on both screens?
to give better insight, here other constraints:
map:
and background photo here:
has following constraints:
please remove top constraint of uilabel.








Comments
Post a Comment