16

I am working on the watchkit app and I want to create a table row with an image and two labels where the labels are one below the other, like this:

enter image description here

I tried the position options in interface builder, but no luck.

enter image description here

The labels are always on the same line:

enter image description here

I want the x-coordinate same for both. Please help.

zisoft
  • 22,770
  • 10
  • 62
  • 73
Pratik B
  • 1,599
  • 1
  • 15
  • 32
  • I don't quite understand what you are trying to accomplish; are you trying to make a tableViewCell with 2 labels that are stacked one on top of the other? So, in your picture, label 2 would be directly below label 1, both with the same x position? – Alex Jan 08 '15 at 15:20

2 Answers2

25

At first, drag a Group onto the interfaceController, then change the Layout property of that group to Vertical:

enter image description here

Then drag the Labels in that group and set their properties accordingly:

enter image description here

If you need other alignments, add another group to the viewController.


EDIT

To achieve the table view you have posted in your question:

  1. put a group on the table row, set its layout to Horizontal
  2. put the image in that group, position Left
  3. put another group in that group, position Left, layout Vertical
  4. put the labels in that second group

Looks like this:

enter image description here

zisoft
  • 22,770
  • 10
  • 62
  • 73
3

You just need to change Layout of that group to Vertical

Axadiw
  • 651
  • 8
  • 19
  • but i also have one label in between middle like one in middle which is leftside and other 2 are one above at right side – Pratik B Jan 08 '15 at 16:47
  • I don't understand what exactly you're trying to accomplish, could you draw how you want to position your labels? – Axadiw Jan 08 '15 at 18:27