Search code examples
objective-cwatchkitapple-watch

Create WKInterfaceButton with image and left aligned text


I want to use a WKInterfaceButton for my watch app, that looks like the buttons in the watch settings:

the watch settings

with two main attributes:

  • It should contain a small image on the left
  • its title should be aligned to the left

I didn't found any possibility to align the title of a button to the left. I already tried to use a group instead (then it would work), but when I use a group I can't use the the shape of WKInterfaceButton.


Solution

  • While i haven't tried this myself i think what you're looking for to match the watch settings is a table view. Define a table view in the interface controller of your story board and add your image and label to the row(s). There's an example of how to do this in the programming guide for apple kit.