获取 .xib 高度以在 heightForRowAtIndexPath 函数中使用它

发布于 2024-12-09 19:34:38 字数 249 浏览 2 评论 0原文

我创建了一个自定义 .xib,其中包含一个 TableViewCell,其中包含 UIImageViewUILabel

我想知道 .xib 文件中的 TableViewCell 高度,而不是在 heightForRowAtIndexPath 函数中手动设置它。

当我在 .xib 文件中手动更改 TableViewCell 的高度时,还有 UIImage 的属性吗?

I have created a custom .xib that contains a TableViewCell that contains a UIImageView And UILabel.

I want to know TableViewCell height in the .xib file, not to set it manually in heightForRowAtIndexPath function.

Also is there a property of UIImage to have the height of the TableViewCell when i change it by hand in the .xib file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寂寞陪衬 2024-12-16 19:34:38

UITableViewCell 实际上是一个 UIView,因此当您从 xib 加载它时,frame 属性可以帮助您:

cell.frame.size.height

UITableViewCell is actually a UIView, so when you load it from xib the frame property can help you:

cell.frame.size.height

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文