Search code examples
ioswatchkit

Is it possible to keep a WKInterfaceButton depressed?


You can click on a WKInterfaceButton, but is there any way to keep it depressed?


Solution

  • There is no official way to do this. Unfortunately, WatchKit and the WKInterfaceButton are fairly limited at this time.

    Outside the box options

    With that said, you could use the setBackgroundColor or setBackgroundImage methods to switch the background of the button to represent a depressed state. You could also use a show/hide with a second button that could accomplish the same affect. The show/hide would be instant and could not be animated, but that may be sufficient for your needs.

    Hopefully that helps shed some light.