我的 Storyboard中有一个 WKInterfaceTable
。当点击一行时,我对记录显示进行更改,但想滚动到顶部。我该怎么做?
这是我的代码到目前为止的样子:
@IBOutlet var currentTable: WKInterfaceTable!
override func table(table: WKInterfaceTable, didSelectRowAtIndex rowIndex: Int) {
// Make changes to records...
// TODO: Scroll to the top???
}
我在 API 中找不到表 currentTable
的任何内容,除非我遗漏了某些内容?
最佳答案
我想知道您是如何在文档中监督这个简单的解决方案的?!
这应该可以解决问题:
override func table(table: WKInterfaceTable, didSelectRowAtIndex rowIndex: Int)
{
// Make changes to records...
table.scrollToRowAtIndex(0)
}
而且你的 socket 似乎是错误的。如果您使用 IB 创建它们,它会自动将它们标记为“弱”。
希望这对你有帮助:)
关于ios - 滚动到 WatchKit 中 WKInterfaceTable 的顶部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29878330/