下面的函数应该 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];
}
这可能是什么原因造成的?提前致谢!