0

我在 listview blackberry 10 qml 中创建了自定义标题。但是 listview 标头也会在 OnTriggered 事件上触发。

listItemComponents: [
    ListItemComponent {
    type: "header"
        Container {
            preferredWidth: 748
            layout: DockLayout {}

            Label {
                text: "Custom Header"
                horizontalAlignment: HorizontalAlignment.Left
                verticalAlignment: VerticalAlignment.Center
                textStyle{
                    base:SystemDefaults.TextStyles.BigText
                }
            }
        }
    }
]
4

1 回答 1

1

最后我找到了答案,实现如下的listview ontriggered函数

onTriggered: {
                        if(indexPath!=0){
                        var selectedItem = dataModel.data(indexPath);
                        var newPage = nextPage.createObject();
                        navigationPane.push(newPage);
                    }
于 2013-01-03T11:38:51.420 回答