Animation QML Type
Is the base of all QML animations
Inherited By:
- AnchorAnimation (只用於結合AnchorChange的Transition中)
- ParentAnimation (只用在一個結合ParentChange的Transition中)
- PathAnimation
- PauseAnimation (動畫執行過程中暫停一段時間)
- PropertyAnimation
- ParallelAnimation(並行動畫)
- SequentialAnimation(順序動畫)
- PropertyAction(動畫執行過程中立即改變某個屬性。屬性改變不是動畫(無動畫效果))
- ScriptAction 動畫執行過程中運行一個腳本(無動畫效果)
Properties
alwaysRunToEnd : bool //主動停止動畫時是否把動畫執行完
loops : int //動畫循環次數。默認爲1,Animation.Infinite無限循環
paused : bool //暫停動畫
running : bool //動畫是否運行,started()會置running 爲true,stopped() 會置running 爲false
Signals
started()//如果動畫在一個分組動畫或Behavior 或 Transition不會觸發信號
stopped() //如果動畫在一個分組動畫或Behavior 或 Transition不會觸發信號
Methods
complete() //完成一個動畫
pause() //暫停,如果動畫已經暫停,它什麼也不幹
restart() //等同於先調用stop()在調用start()
resume() //重啓暫停的動畫,如果動畫沒有暫停,什麼也不幹
start()
stop()
PropertyAnimation
Inherited By:
ColorAnimation, NumberAnimation, RotationAnimation, and Vector3dAnimation
NumberAnimation
Inherited By:
SmoothedAnimation(在from和to之間產生平滑的效果) and SpringAnimation(模仿彈簧震動的效果)