开发者

Increase the size of tableView Cell..?

Is it possible to increase the size of particular cell in the TableView.

-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath: (NSIndexPath *)indexPath
{
    return 100;
}

By using this we can increase the size of the table cell for a tableView but it will increase all the tableCell size.

But I want to increase the height of first cell is up-to 130 and other cell are of height 100. Can any one suggest me the best way f开发者_运维知识库or doing this...


Make height value dependent on cell's position (indexPath), e.g. to make 1st cell higher then others do the following:

-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath: (NSIndexPath *)indexPath{
    if (indexPath.row == 0)
         return 130.0f;

     return 100.0f;
}

*Note that with that code if you have several section then 1st cells in all sections will be higher then others.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜