2017-06-22 93 views
0

由於用戶交互(在集合視圖上持續滾動),我面臨UIViewAnimation中的問題。當用戶滾動集合視圖時,下圖中的RED行凍結(不向前移動)。滾動線移動多個UIView動畫問題

注意:對於線運動,我現在用的是UIViewAnimation 觀察:我正在考慮這個操作是在主隊列這就是爲什麼紅線是凍結在執行時,用戶滾動集合視圖

如何避免這個阻擋?我希望用戶連續滾動收集視圖而不凍結RED線。

enter image description here

+0

你有沒有嘗試過任何機會使'UIViewAnimationOption.allowUserInteraction'或''allowAnimatedContent? –

+0

@Yoam兩者都處於不同的視圖層次結構中。對於紅線移動,我正在使用UIViewanimation。 – HPM

回答

0

**

Finally, i solved above problem by adding animation timer in run loop. 
e.g 
func updateLine() { 
//line animation code goes here. 
} 

let animationTimer = Timer.scheduleTimer(timerInterval: 1, target: self, selector: #selector(self.updateLine), userInfo: nil, repeats: true) 

RunLoop.current.add(animationTimer, forMode: RunloopMode.UITrackingRunLoopMode) 
that's it 

**