gpt4 book ai didi

ios - UITableViewController estimatedRowHeight 与 detailTextLabel

转载 作者:行者123 更新时间:2023-11-29 00:30:21 25 4
gpt4 key购买 nike

简单问题:我有一个 UITableViewController,一般设置工作正常。我只是想微调间距。

UITableViewControllerviewDidLoad中我调用:

tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 60

我的一些默认单元格使用 detailTextLabel (style: .subtitle),有些则不使用 (style: .default)。当它们这样做时,单元格似乎不会调整行高。文本看起来很拥挤,尤其是当 detailTextLabel 是两行时。

我想避免重写 tableView:heightForRowAtIndexPath: 函数?有窍门吗?

谢谢

最佳答案

这是系统单元的默认行为。如果您期望另一个输出,只需创建您的自定义单元格,并根据需要提供顶部和底部约束。祝你好运;)

关于ios - UITableViewController estimatedRowHeight 与 detailTextLabel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42023335/

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