gpt4 book ai didi

ios - 是否必须使用autolayout才能使用stackview

转载 作者:可可西里 更新时间:2023-11-01 00:39:16 24 4
gpt4 key购买 nike

是否有必要强制使用自动布局来仅使用堆栈 View 假设我在没有自动布局的情况下完成了整个项目,现在对于特定的屏幕,我必须使用 Stackview 来平均划分 View 内的标签数量。有什么解决办法吗..

问题

实际上,我必须自定义我的一个没有自动布局的旧项目,现在我只需要修改一个屏幕,它不需要任何约束,只需要像 uitablecell 这样的 stackview,每个单元格中有 8 个标签,平均分配。

I know we can do it by just calculating frame run time but is there is any other way to do it.

最佳答案

是的,有必要使用自动布局来定位堆栈 View 本身

来自Apple Documentation :

Although a stack view allows you to layout its contents without using Auto Layout directly, you still need to use Auto Layout to position the stack view, itself

关于ios - 是否必须使用autolayout才能使用stackview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49291518/

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