Hi,
I have a listview that contains a header, delegate and the footer.
The footer is somehow big and I need the listView to show all this footer not drag a little beyond the last delegate element of the list, how can I achieve this ?
Hi,
I have a listview that contains a header, delegate and the footer.
The footer is somehow big and I need the listView to show all this footer not drag a little beyond the last delegate element of the list, how can I achieve this ?
Have you defined the fotter height?
Does this code work for you?
Rectangle {
anchors.fill: parent
ListView {
clip: true; spacing: 1
width: parent.width
height: parent.height
// It works without Snapping
snapMode: ListView.SnapToItem
model: listModel
delegate: listDelegate
footer: footerAndHeader
header: footerAndHeader
}
ListModel {
id: listModel
ListElement {name: "Dogs"}
ListElement {name: "Cats"}
ListElement {name: "Birds"}
ListElement {name: "Snails"}
ListElement {name: "Horses"}
ListElement {name: "Bugs?"}
}
Component {
id: listDelegate
Rectangle {
width: parent.width
height: 60
gradient: Gradient {
GradientStop {
position: 0.00;
color: "#f9f9f9";
}
GradientStop {
position: 1.00;
color: "#c4c4c4";
}
}
Text {
anchors.centerIn: parent
text: name
}
}
}
Component {
id: footerAndHeader
Rectangle {
width: parent.width
height: 400
gradient: Gradient {
GradientStop {
position: 0.00;
color: "#6d6d6d";
}
GradientStop {
position: 1.00;
color: "#222222";
}
}
}
}
}
not sure i have understand correctly but it seems to me you need to specify a bottomMargin
Keep it simple, stupid (I think to myself)
borg - http://store.ovi.com/content/116105
I didn't thought it was as simple as that !!!
Thanks gnuton
Success is when you realize obstacles you face are challenges to help you become better - and your response equals the challenge.