QMUI_iOS icon indicating copy to clipboard operation
QMUI_iOS copied to clipboard

全面屏设备横屏下 QMUICellHeightCache 计算高度错误

Open evanzhou89 opened this issue 5 years ago • 1 comments

Bug 表现 RT, 见下图,第一个cell的时间label已经超过了cell。 截图 Screen Shot 2020-03-13 at 1 04 04 PM

如何重现 QMUIDemo添加测试数据::1234567890-1234567890-1234567890-1234567890-1234567890-1234567890-1234567890 见截图 Screen Shot 2020-03-13 at 1 04 30 PM

可能原因 QMUICellHeightCache计算的contentWidth和实际cell content view width不一致,这样sizeThatFits里面label计算的所有高度和实际布局的高度是不一致的,最终计算的整个cell高度有误,如下图: Screen Shot 2020-03-13 at 1 06 19 PM Screen Shot 2020-03-13 at 1 05 40 PM Screen Shot 2020-03-13 at 1 10 53 PM

其他信息

  • 设备: 模拟器 iPhone X
  • QMUI 版本: [4.0.4]

evanzhou89 avatar Mar 13 '20 05:03 evanzhou89

在 iOS 11 及以后,如果 UITableView.insetsContentViewsToSafeAreaYES(默认即为 YES)的情况下,QMUICellHeightCache 组件无法拿到准确的 cell 内容宽度(一般指满屏宽减去左右两个 safeAreaInsets 的值),这个问题比较麻烦,后续看如何解决。

MoLice avatar Mar 16 '20 09:03 MoLice