Cleversou
Cleversou

Reputation: 481

Animate a UILabel size doesn't resize the StackView that contains it

guys... I have a button and a vertical stackView with 2 labels inside it. When I tap the button I want to decrease/increase the font size smoothly using animations.

The following code do the animation (within an animation block), but the stackView doesn't resize it self:

self.trackingStatus.transform = CGAffineTransformScale(self.trackingStatus.transform, 0.5, 0.5);

When I use the following code, the stackView does resize, but I don't think you can animate that property:

self.trackingStatus.font = self.trackingStatus.font.fontWithSize(11.0)

Besides the problem with stackView the CGAffineTransformScale makes the text distorted. Could you help me with those two problems?

Thanks a lot!

Upvotes: 1

Views: 192

Answers (0)

Related Questions