美文网首页
UITableView-FDTemplateLayoutCell

UITableView-FDTemplateLayoutCell

作者: csp | 来源:发表于2017-12-15 08:55 被阅读39次

最近项目里使用UITableView-FDTemplateLayoutCell,项目是使用xib创建的自定义的cell,cell里面有一个label是多行的,numberOfLines=0,高度的计算使用的就是UITableView-FDTemplateLayoutCell。但是运行起来有问题,这个label还是一行,显示不全。
之后在xib中配置了这个label的preferred width为0,还是不行。
最后是在这个cell的awakFromNib加上一句:
self.label.preferredMaxLayoutWidth = screenWidth - 30;
解决问题。

相关文章

网友评论

      本文标题:UITableView-FDTemplateLayoutCell

      本文链接:https://www.haomeiwen.com/subject/wldrwxtx.html