我在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
}
}
}
}
]
答案 0 :(得分:1)
最后我找到了答案,实现了listview ontriggered函数,如下面的
onTriggered: {
if(indexPath!=0){
var selectedItem = dataModel.data(indexPath);
var newPage = nextPage.createObject();
navigationPane.push(newPage);
}