QML ListView не прокручивается (если включен в строку)

Ниже код использует ListView в столбце и строке. Но ListView не скроллируется. Любая идея, почему?

import QtQuick 2.0
import Ubuntu.Components 0.1

MainView {
width: units.gu(60)
height: units.gu(60)

Page {
    id: test

    Column {
        spacing: units.gu(1)
        id: pageLayout
        anchors {
            margins: units.gu(2)
            fill: parent
        }

        Row {
            id: buttonRow
            spacing: units.gu(1)
            Button {
                objectName: "button1"
                color: "white"
                text: i18n.tr("Help")
            }
            Button {
                objectName: "button2"
                color: "black"
                text: i18n.tr("Search")
            }
        }

        Row {
            id: listarea
            spacing: units.gu(1)
            anchors.top: buttonRow.bottom
            height: myList.count * units.gu(2)

            ListModel {
                id: fruitModel
                ListElement {
                    name: "Apple"
                    cost: 2.45
                }
                ListElement {
                    name: "Orange"
                    cost: 3.25
                }
                ListElement {
                    name: "Banana"
                    cost: 1.95
                }
            }

            ListView {
                id: myList
                anchors.fill: parent
                model: fruitModel
                delegate: Row {
                    Text { text: "Fruit: " + name }
                    Text { text: "Cost: $" + cost }
                }
            }
        }
    }
}
}
1
задан 30 March 2014 в 19:17

0 ответов

Другие вопросы по тегам:

Похожие вопросы: