Watchkit - 如何在组中将元素设置为一个低于另一个 [英] 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.
推荐答案
首先将一个Group
拖到interfaceController上,然后将该组的Layout
属性改为垂直
:
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
- 把图片放在那个组里,位置
Left
- 在该组中放置另一个组,位置
Left
,布局Vertical
- 将标签放在第二组中
看起来像这样:
这篇关于Watchkit - 如何在组中将元素设置为一个低于另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!