WatchOS 2上的WKInterfaceImage和动态图像

时间:2015-10-15 16:09:11

标签: apple-watch wkinterfaceimage

如果我创建一个UIImage并使用WKInterfaceImage显示它,它总是将图像显示为@ 1x而不是@ 2x,从而产生像素化图像。它适用于watchOS 1.如何使用watchOS 2解决此问题?相同的代码在iOS上使用UIImageView正常工作。

1 个答案:

答案 0 :(得分:0)

以下是以正确的屏幕尺度从Apple Watch上的NSData对象创建图像的解决方案。

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