使用animateTo修改Circle的value,但是动画时间感觉一直都是1秒,设置了duration也没有用
@Entry
@Component
export struct Index3 {
@State countDownProgress: number = 0;
build() {
Column() {
Button('动画')
.onClick(() => {
animateTo( {
duration: 16000,
},() => {
this.countDownProgress = 1;
})
})
Progress({
value: this.countDownProgress,
total: 1,
type: ProgressType.Ring
})
.width(60)
.height(60)
.color(Color.Blue)
.style({
strokeWidth: 2,
})
}
}
}
animateTo动画中duration最长动画时间就是1S,超过1000系统默认为1000,以下有一个实现进度条动画demo,可参考以下: