最近有一個(gè)水機(jī)沖洗動(dòng)畫校哎,發(fā)現(xiàn)動(dòng)畫開始時(shí)两波,從前臺(tái)切換到后臺(tái)瞳步,然后立馬從后臺(tái)切換到前臺(tái)闷哆,這時(shí)動(dòng)畫停止了,只要加上這句代碼就行:
animation.removedOnCompletion = NO;
官方解釋:/* When true, the animation is removed from the render tree once its
- active duration has passed. Defaults to YES. */
當(dāng)為真時(shí)单起,一旦活動(dòng)持續(xù)時(shí)間已過(guò)抱怔,動(dòng)畫將從呈現(xiàn)樹中刪除。默認(rèn)值為YES嘀倒。