I am trying to reduce the width of a UILabel inside an animation, but the width changes instantly without animation! If I increase the width, everything will be fine, and you can see the animation.
Here is my code:
[UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationCurveLinear animations:^ (void){ CGRect theNewFrame = self.titleLabel.frame; theNewFrame.size.width -= 50.0; self.titleLabel.frame = theNewFrame; } completion:^(BOOL finished){}];
So if I change
theNewFrame.size.width -= 50.0;
to
theNewFrame.size.width += 50.0;
You can watch the mark increase. But reducing the width will not work!
I have no explanation for this behavior. This is mistake?
Thank you for your responses!
source share