Animating Frame of UILabel smoothly

前端 未结 5 1705
我寻月下人不归
我寻月下人不归 2020-12-06 12:23

I\'ve been trying to figure out a decent way to smoothly animate a frame size change on a UILabel, without a weird starting jump redraw. What happens by default is that when

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 12:37

    Animating the frame doesn't animate changing the font size. If I understand what you behavior you are seeing, I think you have the label's adjustsFontSizeToFitWidth set to 'True' so you're seeing the frame animate to size followed by the instantaneous readjustment of the font size.

    You might try to scale the label's transform so that the frame and font scale simultaneously.

提交回复
热议问题