简体   繁体   中英

UIStackView inside a UITableViewCell does not adjust correctly on AutoLayout

I have a UIStackView inside my UITableViewCell, which is displaying 6 views (3 labels, 3 textfields). The problem is that it does not display nicely when on iPhone SE.

Stackview的属性

我的手机 The De... textfield was supposed to be Depto. The # textfield shouldnt be so wide. 预习

The header of the table is also a StackView. Any suggestion on how to make it work using AutoLayout?

You just have to distribute your data proportionally in stack view. Stackview will proportionally distribute space for your conrols. 在此处输入图片说明

如果堆栈视图与所需的方式不匹配,则在将填充设置为fill proportionally填充之后,可以为每个标签/值对提供相同的比例宽度,其中总宽度等于1(即0.1、0.2、0.2、0.3 ,0.2)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM