Wednesday, April 13, 2016

WKInterfaceTable add scroll bar "flash' and remove scroll bar from non-scrolling view

Leave a Comment

I have two questions regarding WatchKit:

1) I have an app that uses [WKInterfaceTable]. One of the interfaces is scrollable.As such, when the user scrolls, the scroll bar appears in the top right corner of the watch interface.

How do I get the scroll bar to temporary flash the scroll bar when the user opens the app. A good example of this functionality is the Calendar app in Apple watch. I've combed the net and WatchKit catalog (https://developer.apple.com/library/ios/samplecode/WKInterfaceCatalog/Introduction/Intro.html) but was not able to find a solution.

2) I have another interface that only shows one row on the watch and therefore does not need to scroll. How do I remove the scroll view in this case?

I am using WatchKit 2.0 and writing the app in Objective-C.

1 Answers

Answers 1

I wonder if you could get the desired effect by scrolling to the top programmatically after the view has loaded?

table.scrollToRowAtIndex(0)

If that didn't work, then perhaps (again after load) scroll to the second row and then back to the first to cause the bar to display?

table.scrollToRowAtIndex(1) table.scrollToRowAtIndex(0)

I haven't tried this, but I have programmatically traveled to rows in a WKInterface table and I believe you do get the scroll bar.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment