我可以在 Apple Watch 上显示 iOS 图表 (MPAndroidChart) 吗?
Can I display iOS Charts (MPAndroidChart) on an Apple Watch?
我在 iPhone 上安装了 iOS 图表框架和 运行。我想知道是否有办法将我的 iPhone 中的图表显示到 Apple Watch。
我该怎么做?
我猜没有,WatchKit中没有class类似UIView的。不知道watch os 2支持不支持,你可以看看
但是,您可以尝试使用 WKInterfaceImage 的 func setImage(image: UIImage?) 生成图像并将它们传输到 Watch App
如果你已经有了在-drawRect:中绘图的绘图代码,修改它以支持绘图到图像应该不难
如果您只是在寻找一些条形图或折线图,那里有一些库,例如,
https://github.com/yasuoza/YOChartImageKit
我在 iPhone 上安装了 iOS 图表框架和 运行。我想知道是否有办法将我的 iPhone 中的图表显示到 Apple Watch。
我该怎么做?
我猜没有,WatchKit中没有class类似UIView的。不知道watch os 2支持不支持,你可以看看
但是,您可以尝试使用 WKInterfaceImage 的 func setImage(image: UIImage?) 生成图像并将它们传输到 Watch App
如果你已经有了在-drawRect:中绘图的绘图代码,修改它以支持绘图到图像应该不难
如果您只是在寻找一些条形图或折线图,那里有一些库,例如, https://github.com/yasuoza/YOChartImageKit