您的位置:首页 > 产品设计 > UI/UE

UITableViewCell高度自适应

2016-02-22 11:46 375 查看
第一步:设置UITableViewCell的高度自适应属性,

        _table.estimatedRowHeight =
260.0f;

        _table.rowHeight =
UITableViewAutomaticDimension;

第二步:在实现UITableView协议方法时不需要

       //-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

       //{

       //    return 260.0f;

       //}

第三步:必须设置cell里面子控件约束时最下面一个子控件的bottom约束。

     
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息