How to animate a UILabel from small to original size?
I am actually using RESlider in my application. There is a profile picture in the menu table view, and there is a notification label on the side. Now I want that when the user clicks the hamburger menu, the notification label ( orange label numbered 999 ) should animate from a tiny dot to its original size. How can this be achieved?
+3
source to share
3 answers
myTextLabel.transform = CGAffineTransformMakeScale(0.3, 0.3);
[UIView animateWithDuration:2.0
delay: 0.1
options: UIViewAnimationOptionBeginFromCurrentState
animations:^{
myTextLabel.transform = CGAffineTransformMakeScale(1.5, 1.5); //grow
}
completion:^(BOOL finished){
myTextLabel.transform = CGAffineTransformMakeScale(1, 1);
}];
+2
source to share
Change the transformation scale of your label, for example:
[UIView animateWithDuration:0.5
delay:0.0
options:UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat | UIViewAnimationOptionCurveEaseInOut
animations:^{
timerLabel.transform = CGAffineTransformScale(timerLabel.transform, 0.7, 0.7);
}
completion:nil];
+1
source to share