ios - NSTimer blocks other animations -


description

i have nstimer updates uilabel every second. have uiimageview slides in screen when uibutton pressed.

issue

the problem when nstimer updates uilabel, animation of uimageview stops completing.

question

please can tell me how can update timer without messing other animations?

this common symptom of having auto layout turned on trying slide across screen adjusting frame or center. auto layout ios 6+ feature controls location , size of various uiview elements. unfortunately, when have auto layout on, every time change label's value, reapply constraints dictate label should positioned, defeating attempts animate it.

two solutions:

  1. turn off auto layout opening storyboard or nib, click on first "document inspector" tab on rightmost panel, , uncheck "use autolayout".

    show autolayout

  2. if want use autolayout, animate moving of control changing constraints rather changing frame or center. see here example of how can create iboutlet constraint , change constraint programmatically in animatewithduration block.

references:


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -