1

是否可以使用 Apple Watch 将 UIButton 放置在 UIImage 内?似乎我只能将对象并排放置,而不是像使用 iOS 一样放在它们之上

4

2 回答 2

0

Short answer, you can't really place items on top of each other with WatchKit, but you can use the background image of a group to do it:

Can I position interface elements on top of each other?

No, interface elements can’t be positioned on top of each other natively. However, there are workarounds. For example, you can use a WKInterfaceGroup and set its background image to something that represents the control you want to overlay. Inside the group you can then add the necessary labels, buttons and so on.

This comes from Ray Wenderlich's WatchKit FAQ, which is a pretty reliable source. I'll link to fully official sources if I find it.

The solution is, as stated above, to use a WKInterfaceGroup and set its background image to something that represents the control you want to overlay. Inside the group you can then add the necessary labels, buttons and so on.

Note that this question also is about laying elements on top of images.

于 2015-04-27T15:06:07.213 回答
0

据我所知,你不能那样做。

但是可以做的是创建一个按钮并将其设置为 backgroundImage。

希望有帮助:)

于 2015-04-27T15:09:44.900 回答