是否有必要使用autolayout来使用stackview [英] Is it necessary to use autolayout to use stackview

查看:127
本文介绍了是否有必要使用autolayout来使用stackview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否必须强制使用autolayout才能仅使用stackview 假设我没有自动布局就完成了整个项目, 现在对于特定的屏幕,我必须使用Stackview来平均划分视图内的标签数. 有什么解决办法吗?.

Is it necessary to compulsory use autolayout to just use of stackview suppose i have made whole project without autolayout, now for particular screen i have to use the Stackview to equally divide the number of label inside the view. is there is any solution for that..

问题

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

actually i have to customize one of my old project done without autolayout, Now i have to just modify one screen which does not require any constraint but just stackview like uitablecell with 8 label in each cell equally divided.

我知道我们可以通过计算帧运行时间来做到这一点,但是有 其他任何方式.

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

推荐答案

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

Yes, it is necessary to position the stack view itself using Auto Layout

Apple文档:

尽管堆栈视图允许您在不使用布局的情况下布局其内容 直接进行自动版式设置,您仍然需要使用自动版式进行定位 堆栈视图本身

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

这篇关于是否有必要使用autolayout来使用stackview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆