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:

enter image description here

the yellow field text view has following constraints:

enter image description here

and:

enter image description here

this looks fine on iphone 5. however, when run on iphone 6, see:

enter image description here

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:

enter image description here

can explain me why view differ on both screens?

to give better insight, here other constraints:

map:

enter image description here

and background photo here:

enter image description here

has following constraints:

enter image description here

please remove top constraint of uilabel.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -