简体   繁体   English

如何根据内部视图出口自动设置表格单元格行高?

[英]how to set tablecell row height automatically based on inner view outlet?

I want to set tableview cell height automatically to show the label completely without happening like that?我想自动设置 tableview 单元格高度以完全显示标签而不会发生这样的事情?

在此处输入图片说明

Any help?有什么帮助吗?

There are 2 things that you need to do:您需要做两件事:

1st thing: Set AutoLayout for it.第一件事:为它设置 AutoLayout。 2nd thing: implement these code:第二件事:实现这些代码:

self.tableView.rowHeight = UITableViewAutomaticDimension
self.tableView.estimatedRowHeight = 100

You can see more from my project: https://github.com/khuong291/Yelp你可以从我的项目中看到更多: https : //github.com/khuong291/Yelp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM