Custom UITableViewCell built using IB resizing?

对着背影说爱祢 提交于 2019-12-04 13:11:28

If its the height of the cell that is not resized I suggest you to modify the UITableView delegate method after rotation.

-

(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if(condition)// has rotation taken place
    // new height
    else
    // old height
    }

Pls make sure that you call [tableView reloadData]; when rotation has taken place.

If i understand your question, you want to change the height of UITableViewCells, right? Try adding this line in your TableView's delegate:

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

I was having the same problem. If you set the size in IB, you can put more stuff in there, but it will still ask your delegate for the height when loading. If your delegate does not implement this method, it will simply take the default height.

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