【发布时间】:2013-07-03 00:29:16
【问题描述】:
我正在使用以下方法使 UIImageView 向前滑动一点,然后再向后滑动更远以获得视差滚动效果。
代码:
[UIView animateWithDuration:0.2f animations:^{
spendrBckGrnd.frame = CGRectMake(spendrBckGrnd.frame.origin.x + 20, 0, spendrBckGrnd.frame.size.width, spendrBckGrnd.frame.size.height);
}];
[UIView animateWithDuration:0.4f animations:^{
spendrBckGrnd.frame = CGRectMake(spendrBckGrnd.frame.origin.x - 80, 0, spendrBckGrnd.frame.size.width, spendrBckGrnd.frame.size.height);
}];
我想知道如何在动画中应用一些缓动,如果只是突然快速地来回滑动。我想轻松进出滑动动画。
【问题讨论】:
标签: ios objective-c