Watchkit - 如何在Group中将元素设置为低于其他元素 [英] Watchkit - How to set the element one below other in Group
问题描述
我正在使用watchkit应用程序,我想创建一个带有图像的表格行和两个标签,其中标签是一个在另一个之下,如下所示:
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.
标签总是在同一行:
我希望两者的x坐标相同。
请帮助。
I want the x-coordinate same for both. Please help.
推荐答案
首先,拖动组
到interfaceController上,然后将该组的 Layout
属性更改为 Vertical
:
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:
如果您需要其他路线,请将另一个组添加到viewController。
If you need other alignments, add another group to the viewController.
编辑
要实现您在问题中发布的表格视图:
To achieve the table view you have posted in your question:
- 在表格行上放置一个组,将其布局设置为
Horizontal
- 将图像放入该组,位置
左
- 将另一个组放入该组,位置
左
,布局Vert ical
- 将标签放在第二组中
- 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
看起来像这样:
这篇关于Watchkit - 如何在Group中将元素设置为低于其他元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!