objective-cwatchkitwatchos-5

Programmatically add a border to WKInterfaceGroup - Solved


Is it possible to give a WatchKit table cell or WKInterfaceGroup a border width of 2px and a red border color? If not, are there any work-arounds?


Solution

  • It can't be done programmatically, but you can give the impression of a boarder in IB.

    Add a separator above and below the cell's sub-group.

    Add a separator above and below the cell's sub-group.

    Give the cell's main group a background color.

    Give the cell's main group a background color.

    Make the first separator an alpha of 0 and a top vertical alignment.

    Make the first separator an alpha of 0 and a top vertical alignment.

    Give the cell's sub-group a center vertical alignment.

    Give the cell's sub-group a center vertical alignment.

    Give the second separator an alpha of 0 and a bottom vertical alignment.

    Give the second separator an alpha of 0 and a bottom vertical alignment.

    I'm pleased with the result.

    I'm pleased with the result.