开发者

How increase the cell height at run time in iphone sdk

According to the following image, the output is a table view. In section 3 the height of each cell is 200. In each cell I have placed one label which has the same height 开发者_运维知识库as the cell height i.e. 200. After that I place one more label to display the text from XML which is in gray color. This text is dynamic. I want to resize the cell height according to the this text label because after that I want to place 6 more label to display more data. For your reference you can see in a different color. For that I write following code.


For all rows:

[tableView setRowHeight:44];

For each row individually:

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
   //return appropriate value based on IndexPath.row
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜