I have an UbuntuListView
in a QML application for Ubuntu Touch.
Above it, there's another component - a TextField
.
The initial position of the list looks good. Also, if the list is smaller than the available area, there are no issues with scrolling.
However, if the list is large enough, while scrolling and also after the scrolling is finished, the list overlaps the component above:
Main.qml
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.2
MainView {
width: units.gu(40)
height: units.gu(30)
Page {
ColumnLayout {
spacing: units.gu(1)
anchors {
margins: units.gu(2)
fill: parent
}
TextField {
id: textInput
Layout.fillWidth: true;
placeholderText: i18n.tr("Add an item")
}
MyList {
anchors {
left: parent.left
right: parent.right
}
Layout.fillHeight: true
}
}
}
}
MyList.qml
import QtQuick 2.4
import Ubuntu.Components 1.2
import Ubuntu.Components.ListItems 1.0
Item {
ListModel {
id: listModel
ListElement {itemName: 'one'}
ListElement {itemName: 'two'}
ListElement {itemName: 'three'}
ListElement {itemName: 'four'}
}
UbuntuListView {
anchors.fill: parent
model: listModel
delegate: ListItem {
id: listItem
divider.visible: false
Label {
id: label
text: itemName
verticalAlignment: Text.AlignVCenter
height: parent.height
}
}
}
}
I tried changing the z
property on the components, but it didn't help.
Am I misusing the API? Or is it a bug in the Ubuntu SDK? (and if so, is there any workaround possible?)