您可以将需要的系统 qml 文件添加到您的项目并进行编辑。对于您的示例,从 PageStack.qml 更改代码:
// Start state for pop entry, end state for push exit.
State {
name: "left"
PropertyChanges { target: container; x: -width }
},
// Start state for push entry, end state for pop exit.
State {
name: "right"
PropertyChanges { target: container; x: width }
},
到
// Start state for pop entry, end state for push exit.
State {
name: "left"
PropertyChanges { target: container; x: width }
},
// Start state for push entry, end state for pop exit.
State {
name: "right"
PropertyChanges { target: container; x: -width }
},
而且我也想知道如何更轻松地做到这一点。