Get .xib height to use it in the heightForRowAtIndexPath function

旧巷老猫 提交于 2020-01-06 04:57:05

问题


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?


回答1:


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

cell.frame.size.height



来源:https://stackoverflow.com/questions/7738209/get-xib-height-to-use-it-in-the-heightforrowatindexpath-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!