ioswatchkitapple-watchwkinterfaceimage

How can I change frame or size of WKInterfaceImage object for Apple Watch?


How can I change size of WKInterfaceImage object? Official documentation doesn't provide any way to do this simple step.


Solution

  • The UIImage you provide to a WKInterfaceImage should already have the desired size. If it doesn't, resize it on the iPhone before sending it to the watch.

    If you want to change the size anyway, call setWidth(_:) and setHeight(_:). This will also change the scaling mode of your image to "scale to fill".