Encounter the above problems can be seen in your cell height is there, the height of the custom, there is continued to see, no further Baidu ...
In the text layout, there is no adaptive text height, line spacing or something, obviously the height of the cell is not fixed, if the use of custom cells, but also in time to send the height of the cell, to assign values;
In-(uitableviewcell*) TableView ... cellforrow ... { You can calculate the cell height in the inside, you need to assign the value to the Cell.height= property ;
It is not possible to set the global CGFloat value, because the assignment is not finished, and the Heightrow method has already assigned the null value of float;}
In the Heightforrow method, the cell is retrieved for assignment:
if (indexpath.row<9) {//This inside is full of custom height/before with cell.height= assignment;
UITableViewCell * Cell =[self tableview:tableview Cellforrowatindexpath:indexpath];
return cell.height;
}
That's it.
IOS Tableviewcell The problem encountered in the custom height method, cell height is 0,cell display, cell directly shows the first few instead of ... cell display number is incorrect