2013-06-20 107 views
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]; 
    }]; 
} 

回答

0

ECSlidingViewController 1版本不支持自定義默認滑動動畫。動畫塊的意圖是在內置幻燈片動畫期間爲您自己的子視圖設置動畫。

您可以通過自己動畫過渡,然後調用滑動視圖控制器的重置,同時禁用其動畫,來擺脫一些竅門。

我會推薦轉移到iOS 7並升級到ECSlidingViewController 2.支持自定義轉換,您將可以自定義動畫。