有人知道如何实现线性动画吗?例如,在进度条中,很少有线条从左到右或以任何其他方式在条形图中无限移动?我将只使用QtQuick2原语,而不使用任何额外的C++组件,很高兴看到符合这一要求的任何答案。另外,我知道如何为动画设置无限循环,但实际的问题是如何在无穷大循环中将矩形/线条行从letf移动到右,我只是无法想象这种方法。
发布于 2015-06-15 00:13:14
像那样吗?
Rectangle {
width: 400
height: 30
anchors.centerIn: parent
border.color: "grey"
border.width: 1
clip: true
Rectangle {
id: runner
property double percent: 0.2
width: parent.width * percent
height: parent.height
color: "orange"
NumberAnimation on x { from: runner.width * (-1); to: 400; duration: 2000; loops: Animation.Infinite }
}
}https://stackoverflow.com/questions/30835454
复制相似问题