Consider the following QML snippet:
ListView {
//...
footer: Text {
text: "Sample Text"
}
}
This will display the text "Sample Text" directly at the bottom of the ListView. However, there is no space between the last item in the list and the text.
How do I add some spacing/padding? I've tried setting anchors.top
and anchors.topMargin
but all that does is give me the "Possible anchor loop detected on vertical anchor" warning. Nothing seems to work.
Best Answer
I'm using the
ContactModel.qml
available in the SDK example.To add some spacing between your footer and the last list element you can create a dedicated component for your footer and modify the layout the way you want inside it:
The result: