gpt4 book ai didi

swift - UITableViewAutomaticDimension 及其高度

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

我在 tableView 中使用 UITableViewAutomaticDimension 并且它工作正常,但是当加载表时,我需要单元格的行大小。表的。可能吗?

提前致谢。

最佳答案

使您的 ViewController 符合 UITableViewDelegate,将 TableView 的 delegate 设置为该类,然后使用此方法:

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
let frame = cell.frame
[...]
}

关于swift - UITableViewAutomaticDimension 及其高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45750836/

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