gpt4 book ai didi

ios - Storyboard 中单个 UITableView 内的 10 个单元格(2 行,5 列)的网格

转载 作者:行者123 更新时间:2023-11-30 13:34:16 27 4
gpt4 key购买 nike

我的 Storyboard 中有一个 UITableView。

我想要一个包含 10 个单元格(2 行、5 列)的网格的单个单元格,其标签均匀分布,并且在不同设备上可以很好地缩放。

我目前有:

(UITableViewCell)
Content View
| Stack View (Vertical)
| | Stack View (Horizontal)
| | | Label 0
| | | Label 1
| | | Label 2
| | | Label 3
| | | Label 4
| | Stack View (Horizontal)
| | | Label 5
| | | Label 6
| | | Label 7
| | | Label 8
| | | Label 9

我在外部堆栈 View (垂直)上设置了约束,使其与 4 个边缘的距离为 0

不幸的是,这在 Storyboard中呈现如下:

enter image description here

(第二行只出现了4个标签,因为我忘记添加标签了)

...间隔不均匀。

我需要采取哪些步骤才能使其按照我想要的方式呈现?我做得正确吗?我应该使用嵌套的 CollectionView 来代替吗?

更新

感谢大家的分配:均匀填充设置。现在它可以在 Storyboard 中正确呈现。

enter image description here

但是在我的 iPod Touch 上它看起来像这样:

enter image description here

怎么了?

最佳答案

我认为你只需要设置 distribution property的水平 stackview 到 .FillEqually

关于ios - Storyboard 中单个 UITableView 内的 10 个单元格(2 行,5 列)的网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36256757/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com