I need margins between elements in QML ListView. With this code I get margin of column of elements, but I need margin between each element:
ListModel {
id: listModel
ListElement {
name: "Apple"
}
ListElement {
name: "Banana"
}
}
Component {
id: listDelegate
Rectangle {
width: 250; height: 100
anchors.margins: 30
color: "green"
Text {
id: itexItem
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 40
text: name
}
}
}
ListView {
id: listView
anchors.fill: parent;
anchors.margins: 50
model: listModel
delegate: listDelegate
focus: true
}
I get margin between box of list element. Is it work fine. I need margin between each element of ListView. I need column like:
Element "Apple"
margin
Element "Banana"
Add:
spacing: value
to your ListView
properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With