Search code examples
iosapple-watchwkinterfaceimage

Move a WKInterfaceImage on Apple Watch


I'm trying to move a WKInterfaceImage. So far the answers I've found and code I've run lets me change the width and size. I want to be able to move an image like I would set the frame or offset to animate an image moving across the screen.

Is this possible?

It seems like the OS forces images to layout a without overlapping, I'd like to override this and control their positions.

I thought maybe the clock "glance" could be used (seems like there are more custom images in the glance screenshots I've seen though I haven't figured out how to animate them). Perhaps the glance could let me move things? I checked and GlanceController inherits from WKInterfaceController so maybe not.


Solution

  • Unfortunately, there aren't any frames to set. The position of elements is controlled entirely by the storyboard. You could show/hide certain elements, but that's about it. UI elements can't overlap, short of faking it with custom images.

    I'm not sure what you're talking about with the Glance stuff. Perhaps a perusal of the documentation would be helpful? https://developer.apple.com/watchkit/