用animation改变标签框的大小

我想知道是否有一种方法来改变一个标签的框架的宽度(而不是fontSize或什么)与一个stream畅的animation。

我已经尝试了以下,显然没有工作:

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

所以运行这个代码之后基本上发生了什么,它改变了预期的宽度,但没有任何animation。

有任何想法吗?

你不能改变标签的帧大小…你可以达到正确的animation行为.. set label.contentMode = UIViewContentModeCenter但它看起来很丑

但是你可以…: