How to resize TTTableSubtitleItemCell

拈花ヽ惹草 提交于 2019-12-13 06:26:53

问题


I'm using the three20 framework and added a TTListDataSource, but I want to change the hight of each Cell (optimal would be the high the text takes inside, so that nothing is cut).

I changed some values at Three20UI/TTTableSubtitleItemCell.h to change the inner high is no problem, but the dividing line is not accordingly

regards


回答1:


TTTableViewCell has a class method, that calculates the height of each table row. It's called tableView:rowHeightForObject:. If you are using a custom subclass of TTTableViewCell you need to override this method to return the height you wish. The standard cells will automatically calculate the height base on the cells content.

To use that feature you have to set variableHeightRows to YES on the TTTableViewController.

You cannot change the height of a tableCell from within the cell. The reason is, that a table needs to know the size of it's cell before it's actually created. Without Three20 you would have to use the UITableView delegate to set row heights.



来源:https://stackoverflow.com/questions/3450639/how-to-resize-tttablesubtitleitemcell

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