2015-05-29 103 views

回答

2

您可以從WatchOS 4開始執行此操作。 WKInterfaceController具有此功能。

func scroll(to object: WKInterfaceObject, at scrollPosition: WKInterfaceScrollPosition, animated: Bool) 

只需指定對象(例如,這可以是一個WKInterfaceGroup)要滾動到屏幕爲object頂部,並指定要滾動到屏幕上scrollPosition,你是好。因此,在您WKInterfaceController類:

scroll(to: objectToShowAtTheTopOfTheScreen, at: .top, animated: true) 

Read more on this in the Apple Developer documentation for WKInterfaceController

And the possible values for scrollPosition

1

編號通過滾動到WKInterfaceTable中的特定行,以編程方式滾動接口與WatchKit的唯一方法。