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:
turn off auto layout opening storyboard or nib, click on first "document inspector" tab on rightmost panel, , uncheck "use autolayout".
if want use autolayout, animate moving of control changing constraints rather changing
frame
orcenter
. see here example of how can createiboutlet
constraint , change constraint programmatically inanimatewithduration
block.
Comments
Post a Comment