Animating UILabel Font Size Change

前端 未结 9 2072
醉话见心
醉话见心 2020-11-30 21:31

I am currently making an application that uses a custom View Controller container. Multiple views are on the screen at one time and when one is tapped, the selected view con

9条回答
  •  一向
    一向 (楼主)
    2020-11-30 21:54

    You can change the size and font of your UILabel with animation like bellow .. here I just put the example of how to change the font of UILabel with transform Animation ..

        yourLabel.font = [UIFont boldSystemFontOfSize:35]; // set font size which you want instead of 35
        yourLabel.transform = CGAffineTransformScale(yourLabel.transform, 0.35, 0.35); 
        [UIView animateWithDuration:1.0 animations:^{
            yourLabel.transform = CGAffineTransformScale(yourLabel.transform, 5, 5);
        }];
    

    I hope this helpful to you..

提交回复
热议问题