我想调整 a Switch
(使用 aQtQuick 1.x
或无关紧要2.x
)。
但是,使用参数width
并height
不起作用。
任何想法 ?
您可以自定义切换到您的需求提供定制的indicator
。
默认情况下,这似乎是Item
带有凹槽 ( children[0]
) 和手柄 ( children[1]
) 的两个子项。由于您无法在创建项目之前访问这些属性,因此您可以使用绑定:
Switch {
id: swch
anchors.fill: parent
Binding {
target: swch.indicator
property: 'width'
value: swch.width
}
Binding {
target: (swch.indicator ? swch.indicator.children[0] : null)
property: 'width'
value: swch.width
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句