如何将 MKOverlay 的不透明度设置为完全?

发布于 2024-11-16 05:02:05 字数 55 浏览 4 评论 0原文

如何更改 MKOverlay 的不透明度?

它目前是透明的 - 这是我不想要的。

How can I alter the opacity of my MKOverlay?

It is currently see-through - which I don't want.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冰魂雪魄 2024-11-23 05:02:05

我深入参考了如何做到这一点:

在 TileMap 示例中,我们在 drawMapRect:zoomScale:inContext 中绘制内容。

其中有以下行:

CGContextSetAlpha(context, tileAlpha);

变量 tileAlpha 是您需要设置的内容。

这就是参考所说的内容:

指定不透明度级别的值。值的范围可以从 0.0(透明)到 1.0(不透明)。超出此范围的值将被截断为 0.0 或 1.0。

希望这对将来的人有帮助。

I have found deep into the references how to do it:

In TileMap example one draws stuff in drawMapRect:zoomScale:inContext.

In there is the following line:

CGContextSetAlpha(context, tileAlpha);

The variable tileAlpha is what you need to set.

This is what the reference said:

A value that specifies the opacity level. Values can range from 0.0 (transparent) to 1.0 (opaque). Values outside this range are clipped to 0.0 or 1.0.

Hope this helps someone in the future.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文