在WKInterfaceController中查找WKInterfaceImage的像素大小(Find pixel size for WKInterfaceImage in WKInterfaceCo

系统教程 行业动态 更新时间:2024-06-14 16:58:29
在WKInterfaceController中查找WKInterfaceImage的像素大小(Find pixel size for WKInterfaceImage in WKInterfaceController)

我在WKInterfaceImage中有一个WKInterfaceController ,我正在动态生成UIImage以显示在WKInterfaceImage 。 如何找到我可以在WKInterfaceController显示的最大像素尺寸?

I have a WKInterfaceImage in a WKInterfaceController and I'm generating the UIImage dynamically to display in the WKInterfaceImage. How do I find the maximum pixel dimensions that I can display in the WKInterfaceController for the image?

最满意答案

使用WKInterfaceDevice的screenBounds和screenScale属性来获取可用的屏幕大小和比例。

将此与您对应用程序用户界面的了解相结合,以确定正确的图像大小。 请记住WatchKit应用程序垂直滚动但不是水平滚动。

Use WKInterfaceDevice's screenBounds and screenScale properties to get the available screen size and scale.

Combine this with your knowledge of your app's user interface to determine the correct image size. Remember that WatchKit apps scroll vertically but not horizontally.

更多推荐

本文发布于:2023-04-15 03:17:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/5565af37cd6b2ba1ce1fca06420650ec.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:像素   大小   WKInterfaceImage   WKInterfaceController   pixel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!