0

I would like to know if there is a way to change a label's frame's width (not the fontSize or something) with a smooth animation.

I already tried the following, that did (obviously) not work:

_myLabel.frame = CGRectMake(139,193,42,21);

[UIView animateWithDuration:1 animations:^ {
    _myLabel.frame = CGRectMake(139, 193, 100, 21);
} completion:^(BOOL finished) {
}];

So what basically happened after running this code was that it changed the width as expected but without any animation.

Any ideas?

LinusGeffarth
  • 27,197
  • 29
  • 120
  • 174

1 Answers1

0

You can't change the frame size of labels... You can reach correct animation behavior.. set label.contentMode = UIViewContentModeCenter but it looks ugly

But you can...:

Community
  • 1
  • 1
TonyMkenu
  • 7,597
  • 3
  • 27
  • 49