当增加标签的高度时,一切都很好而且光滑.减少时,标签会立即改变大小,然后使用动画重新定位.
@interface
@property (nonatomic, retain) IBOutlet UILabel *explanationLabel;
@implementation
CGRect frmExpl = explanationLabel.frame;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.75];
frmExpl.size.height -= height;
explanationLabel.frame = frmExpl;
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)
我试过用UIView代替UILabel,当然UIView没有这样的问题.
是否有任何特殊的方法来动画UILabel尺寸减小?
这是一个展示所述问题的最小项目.下载