表格视图单元格行高度不起作用 [英] Table View Cell Row Height doesnt work

查看:114
本文介绍了表格视图单元格行高度不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在表格视图单元格中对行高进行硬编码。运行程序后,它看起来只有一行。我怀疑是因为表格视图行的高度。

I have tried to hard code the row height in the table view cell. After running the program it looks like only one line. I suspect it is because of the height of the row of the table view.

你能告诉我这里出了什么问题吗?

Could you please tell me what went wrong in here?

推荐答案

XCode 9 中, tableview 根据 Autolayout 自动创建估计的单元格。由于你还没有提供自动布局,这就是你得到这个的原因。

In XCode 9, tableview automatically create estimated cells based on Autolayout. Since you have not provide autolayout, that's why you are getting this.

你需要通过选择tableview来禁用估计的和自动的单元格大小,并取消选中这两个选项:

You need to disable estimated and automatic cell size by selecting tableview and uncheck the two options:

给出你想要的值行高,单元格将是相应地创建。

Give value you want to Row height, and cell will be created accordingly.

希望这可以提供帮助。

这篇关于表格视图单元格行高度不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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