Hello,
On Android applications, when the page is larger than the screen, it can scroll down to show it. How can achive that with QML?
I've tried the Flickable item:
Item {
anchors.fill: parent
anchors.leftMargin: 5
Flickable {
id:view
anchors.fill: parent
contentHeight: content.height
Item {
id: content
Text {
id: tWhat
text: qsTr("What")
}
Text {
id: tWhere
text: qsTr("Where")
anchors.top: tWhat.bottom
anchors.topMargin: 300
}
}
}
Component.onCompleted: {
console.log(content.height)
}
}
Item {
anchors.fill: parent
anchors.leftMargin: 5
Flickable {
id:view
anchors.fill: parent
contentHeight: content.height
Item {
id: content
Text {
id: tWhat
text: qsTr("What")
}
Text {
id: tWhere
text: qsTr("Where")
anchors.top: tWhat.bottom
anchors.topMargin: 300
}
}
}
Component.onCompleted: {
console.log(content.height)
}
}
To copy to clipboard, switch view to plain text mode
but content.height returns 0
Bookmarks