watchOS 2 上的 WKInterfaceImage 和动态图像

WKInterfaceImage and dynamic images on watchOS 2

如果我创建一个 UIImage 并使用 WKInterfaceImage 显示它,它总是将图像显示为 @1x 而不是 @2x,从而导致像素化图像。它在 watchOS 1 上运行良好。如何在 watchOS 2 上解决此问题?相同的代码在带有 UIImageView 的 iOS 上运行良好。

这是从 Apple Watch 上的 NSData 对象以正确的屏幕比例创建图像的解决方案。

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