Closed qyzhaojinxi closed 8 years ago
在cell上,通过设置setSingleLineAutoResizeWithMaxWidth设置最大宽度,然后在赋值后执行sizeToFit方法,来实现label宽度自适应。但是设置完成后出现问题。UITableView上第一条数据上label宽度自适应了,其他行数上label宽度出现问题,和第一行宽度一样,文字显示不完整。通过注释掉useCellFrameCacheWithIndexPath这个方法解决掉了,但是cell自动布局却出现错乱了,请问是怎么回事啊
不好意思,是我这边的问题
在cell上,通过设置setSingleLineAutoResizeWithMaxWidth设置最大宽度,然后在赋值后执行sizeToFit方法,来实现label宽度自适应。但是设置完成后出现问题。UITableView上第一条数据上label宽度自适应了,其他行数上label宽度出现问题,和第一行宽度一样,文字显示不完整。通过注释掉useCellFrameCacheWithIndexPath这个方法解决掉了,但是cell自动布局却出现错乱了,请问是怎么回事啊