2013-11-21 45 views
0

我已經設置了核心圖的圖形,我想要循環移動/連續滾動。如果它是uview,它就像如何自動滾動核心圖(iOS)?

[UIView animateWithDuration:10.0f 
          delay:0.0f 
         options: UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse | UIViewAnimationOptionBeginFromCurrentState 
        animations: ^(void){// animation/ frame set 
             } 
        completion:NULL]; 

任何其他的解決方案,也讚賞滾動圖自動與用戶交互。

回答

3

在coreplot你可以使用CPTAnimation像這樣:

zoomInAnimation = [CPTAnimation animate: plotSpace 
           property: @"xRange" 
          fromPlotRange: plotSpace.xRange 
          toPlotRange: plotRange 
           duration: ANIMATION_TIME 
           withDelay: 0 
         animationCurve: CPTAnimationCurveCubicInOut 
           delegate: self]; 

查找CPTAnimation看看如何製作動畫的其他屬性(小數,漂浮等)。

+0

我可以製作這個動畫的順序嗎?,首先從左到右,然後從右到左的動畫? – BaSha

+1

延遲創建第二個動畫「ANIMATION_TIME」,將繪圖範圍設置回原始值。 –