gpt4 book ai didi

iphone - 使用不同类型iphone的自定义单元格计算表格的contentSize.height

转载 作者:行者123 更新时间:2023-12-03 18:23:08 26 4
gpt4 key购买 nike

在我的应用程序中,表格 View 具有不同类型、不同高度的自定义单元格。我想在这个tableView下面放一个 View ,为此我需要计算table contentView的高度,我该怎么做?

之前我曾经这样做过:(noOfRows * cell_height),但那是针对静态高度的。

提前致谢。

最佳答案

UITableView 是 UIScrollView 的子类,因此您可以在 tableview 上使用实例方法 contentSize:

yourtableView.contentSize.height

应该给你tableview内容 View 的高度

关于iphone - 使用不同类型iphone的自定义单元格计算表格的contentSize.height,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3231525/

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