我有一个带有长文本的标签和一个WKInterfaceGroup内的按钮。 我可以在按钮的触摸处理程序上将组滚动到顶部吗?
答案 0 :(得分:5)
您可以在WatchOS 4之后执行此操作。 WKInterfaceController有一个函数。
func scroll(to object: WKInterfaceObject, at scrollPosition: WKInterfaceScrollPosition, animated: Bool)
只需指定要滚动到的object
(例如,这可能是WKInterfaceGroup
),并在屏幕上指定scrollPosition
它应该滚动到(在您的情况下{ {1}})你很好。所以在你的WKInterfaceController类中:
.top
Read more on this in the Apple Developer documentation for WKInterfaceController
答案 1 :(得分:1)
没有。以编程方式使用WatchKit滚动界面的唯一方法是滚动到WKInterfaceTable
中的特定行。