如何根据内部视图出口自动设置表格单元格行高? [英] how to set tablecell row height automatically based on inner view outlet?

查看:24
本文介绍了如何根据内部视图出口自动设置表格单元格行高?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想自动设置 tableview 单元格高度以完全显示标签而不会发生这种情况?

I want to set tableview cell height automatically to show the label completely without happening like that?

有什么帮助吗?

推荐答案

您需要做两件事:

第一件事:为它设置 AutoLayout.第二件事:实现这些代码:

1st thing: Set AutoLayout for it. 2nd thing: implement these code:

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

你可以从我的项目中看到更多:https://github.com/khuong291/Yelp

You can see more from my project: https://github.com/khuong291/Yelp

这篇关于如何根据内部视图出口自动设置表格单元格行高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆