iosswiftwatchkitwkinterfacegroup

WatchKit WKInterfaceGroup With Different Corner Radius


I'm creating a WatchKit 2.0 application which includes a conversation between members. In the conversation thread, I'm would like to have the WKInterfaceGroup's radius set for 3 of the corners like so:

enter image description here

In the interface builder I know you can only set the radius for each corner of the WKInterfaceGroup, but is it was possible to programmatically set the radius for 3 of the corners?


Solution

  • All of the programmatic access is listed in Apple's documentation: https://developer.apple.com/library/ios/documentation/WatchKit/Reference/WKInterfaceGroup_class/#//apple_ref/occ/instm/WKInterfaceGroup/setCornerRadius:

    I suspect the easiest way to achieve this is to layer two groups, one with the bigger radius and one with the smaller. You'd probably have to make them different sizes to get the one corner to show as sharper.