首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WKInterfaceTable中的部分

WKInterfaceTable中的部分
EN

Stack Overflow用户
提问于 2015-03-21 09:21:13
回答 1查看 354关注 0票数 1

我正在尝试创建一个具有不同行数的部分的表。我在这里看到了How to create sections in WKInterfaceTable的解决方案,并尝试了如下方法:

代码语言:javascript
复制
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如下:

代码语言:javascript
复制
let rowTypes = ["teamSection", "teamRow", "teamSection", "teamRow", "teamRow", "teamRow", "teamRow", "teamRow", "teamRow", "teamRow", "teamRow"];

我本来想要11行,但只得到9行,它们都是teamRow类型,而不是teamSection类型。有人能发现哪里出了问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-21 15:11:07

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29181090

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档