我正在尝试创建一个包含不同行数的部分的表。我看到了这里给出的解决方案How to create section in WKInterfaceTable并尝试如下:
tableView.setRowTypes(rowTypes);
for q in 0...rowTypes.count-1 {
if (rowTypes[q] == "teamSection") {
let row = tableView.rowControllerAtIndex(q) as? teamSection;
}
else {
let row = tableView.rowControllerAtIndex(q) as? teamRow;
}
}
我有我rowTypes
的如下:
let rowTypes = ["teamSection", "teamRow", "teamSection", "teamRow", "teamRow", "teamRow", "teamRow", "teamRow", "teamRow", "teamRow", "teamRow"];
我期待 11 行,但只得到 9 行,它们都是teamRow
类型,没有teamSection
. 谁能发现做错了什么?