我正在嘗試動畫UIlabel首先變大,然後縮回原始框架。按預期擴大工作,但不縮小。當我用下面的代碼縮小標籤時,尺寸會在原點移動之前先進行調整。這會導致兩步動畫不平滑。動畫UILabel不光滑
這裏是我的代碼:
CGRect rect = label.frame;
[UIView animateWithDuration:.2
delay: 0.1
options: UIViewAnimationOptionBeginFromCurrentState
animations:^{
label.frame = CGRectMake(rect.origin.x + 4,
rect.origin.y + 4,
rect.size.width-8,
rect.size.height-8);
}
completion:^(BOOL finished){
}];
你不是做一個過渡。你爲什麼使用'UIViewAnimationOptionTransitionNone'? – 2011-06-14 01:04:02
不要忘了給予賞金:) – jmosesman 2011-07-02 05:32:34