I have two button with images and i want to overlap one over another. Is it even possible to do it iOS Watch? Moreover, how to handle background or foreground depth of a WKInterfaceObject in watch programming, like sendViewtoBackground or bringSubViewtoFront, as in normal iOS programming ?
This is possible since watchOS4: You can use groups to create overlapping content. Set the group's Layout attribute in the Attribute inspector to "Overlap". The system positions each item in the group based on the item's alignment attributes.
More info @ https://developer.apple.com/documentation/watchkit/wkinterfacegroup
WatchOS4+
For Watch OS4+ follow the answer that @DrMickeyLauer gave.
Outdated answer
In the watch you don't have a Z hierarchy.
The max you can do is using a group, that has a background and then have controls over that background.
Another alternative (hack?) is to render all your hierarchy into an UIImage and set it in the watch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With