问题
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:
I tried the position options in interface builder, but no luck.
The labels are always on the same line:
I want the x-coordinate same for both. Please help.
回答1:
At first, drag a Group onto the interfaceController, then change the Layout property of that group to Vertical:
Then drag the Labels in that group and set their properties accordingly:
If you need other alignments, add another group to the viewController.
EDIT
To achieve the table view you have posted in your question:
- put a group on the table row, set its layout to
Horizontal - put the image in that group, position
Left - put another group in that group, position
Left, layoutVertical - put the labels in that second group
Looks like this:
回答2:
You just need to change Layout of that group to Vertical
来源:https://stackoverflow.com/questions/27841719/watchkit-how-to-set-the-element-one-below-other-in-group