1.常见问题,
a.UILabel的高度自适应,
b.TableViewCell高度的自适应。
2.解决方案:UILabel高度的自适应, 首先是设定好label的约束。

UILabel属性设置:

主要代码包括2段:2个缺一不可
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{    return UITableViewAutomaticDimension;}- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{        return 170;    }
新闻热点
疑难解答