Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a round WKInterfaceButton in watchkit?

iOS can use layer.cornerRadius to make a round UIButton.

Does WKInterfaceButton have this property?

If not, how can I make a round WKInterfaceButton in WatchKit.

like image 697
Suzanne Shansha Avatar asked Dec 25 '22 07:12

Suzanne Shansha


1 Answers

If you put an image inside a group, you can then set the radius of the group. This crops the image into a circle. In the picture below, I have:

  • Group (radius 56)
    • Group (radius 52)
      • Image (a square image)

Watch Screenshot

While this example is with an image, you can use the same technique for a button. Previously the dog was clickable as a button so this is doable.

like image 147
Vanessa Forney Avatar answered Jan 28 '23 23:01

Vanessa Forney