WKInterfaceTable 中的部分
Sections in WKInterfaceTable
我正在尝试创建一个 table,其中的部分具有不同的行数。我看到这里给出的解决方案 How to create sections 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
的 none。
任何人都可以发现哪里做错了吗?
看起来 teamSection
不是有效的行类型。您确定已在情节提要中设置了两行 table 并将其中一行的标识符正确设置为 "teamSection"?
我正在尝试创建一个 table,其中的部分具有不同的行数。我看到这里给出的解决方案 How to create sections 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
的 none。
任何人都可以发现哪里做错了吗?
看起来 teamSection
不是有效的行类型。您确定已在情节提要中设置了两行 table 并将其中一行的标识符正确设置为 "teamSection"?