Berry Blue
Berry Blue

Reputation: 16482

WKInterfaceImage and dynamic images on watchOS 2

If I create a UIImage and display it using a WKInterfaceImage it always displays the image as @1x instead of @2x resulting in a pixelated image. It worked fine with watchOS 1. How to fix this behavior with watchOS 2? The same code works fine on iOS with a UIImageView.

Upvotes: 0

Views: 295

Answers (1)

Berry Blue
Berry Blue

Reputation: 16482

Here is the solution for creating the image from an NSData object on the Apple Watch at the correct screen scale.

UIImage *image = [UIImage imageWithData:imageData scale:[[WKInterfaceDevice currentDevice] screenScale]];

Upvotes: 0

Related Questions