1

我正在尝试创建一个包含不同行数的部分的表。我看到了这里给出的解决方案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. 谁能发现做错了什么?

4

1 回答 1

0

看起来teamSection不是有效的行类型。您确定您已在情节提要中设置了两行表格,并将其中之一的标识符正确设置为“teamSection”吗?

于 2015-03-21T15:11:07.173 回答