gpt4 book ai didi

Swift:表格 View 中的动态单元格

转载 作者:行者123 更新时间:2023-11-28 06:12:00 26 4
gpt4 key购买 nike

我试图让表格 View 单元格的高度 = 单元格的内容。

我在 viewDidLoad() 中实现了这两行:

tableView.estimatedRowHeight = 200.0
tableView.rowHeight = UITableViewAutomaticDimension

and here are the constraints in the cell

不过,单元格正在改变它的高度!

最佳答案

默认情况下,TextView 不会扩展以适应整个文本,因为它具有滚动功能,对于您想要的,您应该禁用 textView 中的滚动。

选择 textView 并在 Attributes Inspector 选项卡中向下滚动并取消选中“Scrolling Enabled”

关于Swift:表格 View 中的动态单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46274467/

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