I want to use a QML TextArea on a mobile device, where the user cannot scroll by swiping through the contents. Instead I want the widget to grow with the content (which I can do by utilizing contentHeight).
But I am unable to disable the scrolling behavior. TextArea has this scrolling behavior because it inherits from ScrollView.
答案 0 :(得分:2)
您可以使用ScrollView的属性flickableItem
来更改或禁用滚动行为。在你的情况下,我使用:
TextArea {
flickableItem.interactive: false
}
如果您想要做其他事情,请查看QML的Flickable
,您应该能够像使用其他任何Flickable
一样使用其所有属性。