Search code examples
tableviewwatchkitapple-watch

WatchKit table with section header and accessory view


I would like to make a table in my WatchKit app that looks like this:

enter image description here

So I want to have a section header (WRIST), and then a table with a custom number of rows where the first and the last have rounded edges, and I want to be able to select one of them.

As far as I saw this cannot be done out-of-the-box. Am I missing something? Any ideas how to do this?


Solution

  • This can be done, but the pattern is not the same as it is in the iPhone. You will need to make 3 separate cell templates. The top one will contain your header and the cell text with rounded corners on the top. The second would contain just the cell text data and square corders. The third would contain the cell text and have rounded corners at the bottom.

    Note that you will need to use a background image to get a cell to have rounded corners on one side and edges on the other.