I am trying to set the corner radius for the bottom left and bottom right corners for a WKInterfaceGroup. I was able to set only one single radius value and that would change it for all the corners. I couldn't find a way to access the CALayer to specify it there either.
Is there a way this can be done?
Thanks!
(The group would contain 2 labels and would be in contact with the sash in the dynamic notification interface.)
You asked about WKInterfaceGroup, but from your response to @BalestraPatrick it sounds like you are specifically trying to achieve bottom corner rounding in the long-look notification, correct?
If so, it's a bug in the current beta.
Assuming you can sign in, here's a developer forum describing the bug: https://devforums.apple.com/message/1098796
The gist is: there used to be a boolean on the Category (where sash color is) to offset content (that's what Apple's Documentation is referring to here https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/BasicSupport.html) but they took it out of Beta 5. Now, you are supposed to be able to set the background color of the notification controller itself and it will do the rounding for you. Just doesn't work yet.
I've logged a bug with Apple and had it closed as a "duplicate" - which means it's a bug and they know about it. Feel free to log again - it increases the priority of the bug in their queue :)
I hope this answer is what you're looking for.
After thinking about it for some time, I came up with a solution. There is no solution in code. I think this is how Apple is doing the same effect for the calendar notification view.
You need to make the main group's backgroundColor white. Then in the top group set the background color to some other color (like red in my case). Then add another group with the same background color as the container group. The result should be like this in the Apple Watch Simulator.
来源:https://stackoverflow.com/questions/28703352/wkinterfacegroup-bottom-corner-radius