6

我在 QML 中实现了一个简单的列表模型和列表委托,现在很好奇使底层列表循环是否可行。这是代码片段:

      Common.MarketsListView {
      id: markets
      anchors.top: logoImage.bottom
      anchors.topMargin: 5
      cacheBuffer: 20000

      NumberAnimation on x {
          running: runtime.isActiveWindow
          loops: Animation.Infinite
          from: 0
          to: -300
          duration: 20000
      }

目前,列表缓慢地向左移动,但当它到达末尾时,只显示最后几项。所以我要么使底层列表循环,要么硬编码跳转到第一个列表项:(

4

1 回答 1

5

您不能使用 ListView 执行此操作,但您可以使用 PathView 获得所需的行为,例如https://doc.qt.io/archives/qt-4.7/declarative-ui-components-spinner.html

于 2010-11-22T00:52:27.770 回答