验证中...
关键的函数
Raw Copy
var myListItemObject = listview.contentItem.children[index]
简单的例子
Raw Copy
ListView {
id: listview
model: 10
delegate: Textfield {
// xxxxx
function getText() {
return text;
}
}
function getAllTtext() {
var allText = [];
for (var i = 0; i != listview.contentItem.children.length; ++i) {
var text = listview.contentItem.children[i].getText();
allText.push(text);
}
return allText;
}
}
关于spacing带来的问题
Raw Copy
for (var i = 0; i !== listview.contentItem.children.length; ++i) {
if (typeof infoListview.contentItem.children[i].getText !== "function") {
// 或者 === "undefined"
continue;
}
var text = listview.contentItem.children[i].getText();
allText.push(text);
}

Comment list( 1 )

1449722_mreo
MrEO 2019-02-21 10:18

建议通过model进行操作和控制

You need to Sign in for post a comment

Help Search

183227_9af5e6a8_1826025 111910_4d91f001_1826025