写了一个色彩闪烁的动画,原理来说就是将两个colorAnimation放到了SequentialAnimation里。而调用的时候直接start,停止的时候使用stop。
SequentialAnimation{
id:_flash_bg
loops: Animation.Infinite//选择无限循环保证会不停地切换动画
ColorAnimation {
from: control.check_color
to: control.uncheck_color
duration: 400
target: indicator
properties: "color"
}
ColorAnimation {
to: control.check_color
from: control.uncheck_color
duration: 400
target: indicator
properties: "color"
}
}