简体   繁体   中英

Can I add button on Map in watchkit?

我正在尝试为Apple Watch OS 2构建应用程序,因此我想知道是否可以在地图顶部添加按钮或图像?

As far as I know, there isn't such a thing like "multiple layers", as you might call it, which would allow you to arrange a thing on top of another thing, in WatchOS yet.

So, I don't think, that the thing you want would work, sorry.

You would need to do your own tile rendering to do something like that. I have four buttons over the top of my maps and I render custom waypoints and routes on the map. To do that I have a custom tile render that generates an image that I set for the watch background and then I overlay buttons on top of it. Here is some more info on how I overlay the buttons Is it possible to position views on top of each other . (One thing that has changed since that post is that I no longer break the background up into four images, I can just set the background as a single image. Somehow I missed that when I initially read the API docs. Also, I turned off the animations for watchOS 1 and I have them on for watchOS 2.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM