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(模仿弹簧震动的效果)