0
以下函數應該A.使視圖變大B.等待5秒鐘C.再縮小它。問題是A瞬間發生,而不是在兩秒鐘內發生。鏈接的動畫:第一個是即時的
- (void) showAndHide {
CGRect r = self.frame;
float right = r.origin.x + r.size.width, h = r.size.height, y = r.origin.y;
[UIView animateWithDuration:2
delay:0
options:UIViewAnimationOptionCurveEaseInOut|UIViewAnimationOptionAllowUserInteraction
animations:^{
self.frame = CGRectMake(right - 400, y, 400, h);
[UIView animateWithDuration:2
delay:5
options: UIViewAnimationOptionOverrideInheritedCurve |
UIViewAnimationOptionCurveLinear |
UIViewAnimationOptionOverrideInheritedDuration
animations:^{
self.frame = CGRectMake(right - 40, y, 40, h);
}
completion:nil];
}
completion:nil];
}
可能是什麼造成的?提前致謝!