objective c - Behavior changes for updateViewConstraints in iOS 8 -


i notice small graphical glitches while testing 1 of app under ios 8: uiviews elements not in right place, others have not right size.

in first step, use storyboard, auto-layout , constraints. programmatically tune constraints suits devices' screen size, using updateviewconstraints.

perfect on ios 7 glitches on ios8 on following picture: ./users/dominiquevial/documents/informatique/dev/novae marathon/_log/captures/ios8 - iphone 6/pause.png

after investigation found problem: updateviewconstraints not called. don't understand why, maybe due optimizations...

correcting problem easy :

  1. use viewwilllayoutsubviews in place of updateviewconstraints
  2. or add call setneedsupdateconstraints in viewwillappear

which way best 1 ?

depends if user can cause views enter invalid state after view appears, if first option. if not possible second.

the less work app has better.


Comments