获取 .xib 高度以在 heightForRowAtIndexPath 函数中使用它
我创建了一个自定义 .xib,其中包含一个 TableViewCell,其中包含 UIImageView
和 UILabel
。
我想知道 .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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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