当增加标签的高度时,一切都很好,很平滑。减少时,标签会立即改变尺寸,然后用动画重新定位。动画UILabel尺寸减少
@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];
我试着用UIView替换UILabel,当然UIView没有这样的问题。
是否有任何特殊的方式来动画UILabel大小减少动画?
这是一个展示所述问题的最小项目。 Download
你从哪里得到frmExpl? – deanWombourne 2010-07-21 11:46:23
从nib文件中设计的标签框架。更新。 – Pablo 2010-07-21 11:50:32
http://stackoverflow.com/questions/17360402/why-are-animations-on-bounds-of-an-uilabel-only-working-when-increasing-the-size – 2014-03-06 06:15:51