objective-cswiftwatchkitwkinterfacegroup

Apple Watch: Is there a native way to add "color stripe" on the left side of a "WKInterfaceGroup"


I know this question may seem odd, but I seen this youtube video that has exactly what I want. Basically in the video it shows a "WKInterfaceGroup" that has a color stripe on the side. I am wondering if there is a native way of doing this? If not, what would be the best way to achieve this? I assume adding an image.

Please check the youtube video at 0:33 to see what I mean.

https://www.youtube.com/watch?v=tn3u9rb2x4Y

and here is an image I've seen on google to demonstrate what I want.

enter image description here


Solution

  • There's no native way of doing this, other than manually constructing it or an image.

    To make it yourself...this is what I would do

    1. make the line by using a group element
    2. Make the width of the group to be about 5px
    3. Make the height of the group relative to the container. Give it a value of about 0.9 or 0.8 to allow for padding on the top and bottom
    4. Center the group element vertically (i imagine you'll be placing this into a larger group container)
    5. make that group element green, or blue, or red
    6. And finally you can adjust the radius of the group to determine how round you want it

    Be sure to align it horizontally to the left, and make sure your insets of your parent container have the right values for proper spacing