• 根据内容计算cell的高度



    // 在自适应高度的时候,需要先计算出内容的高度然后再设置cell的高度。lable使用sizetofit就可以了。

    +(CGFloat)getCellHeightWithItem:(FXCreativeGiveupReasonInfo *)item { // if (item.rowH) {//如有rowH就直接返回,避免重新计算 // return item.rowH; // } NSMutableParagraphStyle *paragraphStyle1 = [[NSMutableParagraphStyle alloc] init]; [paragraphStyle1 setLineSpacing:6];// 行间距 // 计算cell的行高的关键变高控件的高度 CGRect sizeH = [item.abReason boundingRectWithSize:CGSizeMake(ScreenWidth, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14],NSParagraphStyleAttributeName:paragraphStyle1} context:nil]; return sizeH.size.height; }
  • 相关阅读:
    Thread.join
    Thread.yield
    线程的生命周期
    HashMap底层原理
    Web Services
    Struts2框架
    hibernate乐观锁实现原理
    Hibernate框架
    oracle exp 无法导出空表
    linux 远程复制文件或文件夹
  • 原文地址:https://www.cnblogs.com/weipeng168/p/6293870.html
Copyright © 2020-2023  润新知