1

I'm building a watch kit extension for my app that includes a WKInterfaceTable. Now I'd like to add a detailTextLabel to the row and place it under the main label. I don't know why but I can only drag it next to the main label not under the primary label. Does someone know why and how I can solve it? I just want to display a detailTextLabel like in the iOS app. Thanks for your support!

joern
  • 27,354
  • 7
  • 90
  • 105

1 Answers1

2

The table row controller contains a WKInterfaceGroup which contains your both WKInterfaceLabels. You have to select Vertical as the WKInterfaceGroup's Layout attribute to put the labels on top of each other.

enter image description hereenter image description here

UPDATE:

To add a WKInterfaceImage on the left side of your labels you have to use the following setup:

enter image description here

You need to set the following values:

Group1:

  • Layout: Horizontal
  • Height: Size To Fit Content

Image:

  • Size: Relative To Container, Factor: 0,3

Group2:

  • Layout: Vertical
  • Size: Relative To Container, Factor: 0,7

Labels:

  • Width: Relative to Container, Factor: 1

You probably have to play around with the Size factors of the image and the labels group. The sum of these two width factors has to be 1.

joern
  • 27,354
  • 7
  • 90
  • 105
  • Thanks for your answer! But I also have an image view which should be displayed next to the 2 labels. This doesn't work right? – user5473123 Oct 21 '15 at 20:23
  • No problem! Glad I could help :-) – joern Oct 21 '15 at 21:15
  • Is there also a `label.hidden` to hide a label? The 2nd label should be displayed every time so I can hide it if it's possible. – user5473123 Oct 21 '15 at 21:20
  • Yes. All classes that are subclasses of `WKInterfaceObject` have `setHidden` and `setAlpha` methods that you can use to hide interface objects. – joern Oct 21 '15 at 21:22