0
我找不到任何地方使用resetTopViewWithAnimations的例子。示例应用程序不使用动画,并且我见过的每个论坛都没有提及如何使用此方法实际实现动画。有人可以解释我将如何实现基本的反弹效果(视图重置为居中然后反弹几次)?ECSlidingViewController动画实现弹跳效果
https://github.com/edgecase/ECSlidingViewController
- (void)resetTopViewWithAnimations:(void(^)())animations onComplete:(void(^)())complete
{
[self topViewHorizontalCenterWillChange:self.resettedCenter];
[UIView animateWithDuration:0.25f animations:^{
if (animations) {
animations();
}
[self updateTopViewHorizontalCenter:self.resettedCenter];
} completion:^(BOOL finished) {
if (complete) {
complete();
}
[self topViewHorizontalCenterDidChange:self.resettedCenter];
}];
}