MyLinearLayout icon indicating copy to clipboard operation
MyLinearLayout copied to clipboard

急:UIScrollView 中 使用tableview,cell不会加载

Open zhaoyongjiang opened this issue 5 years ago • 2 comments

一:我是在demo中的LLTest2ViewController中实践的。。scrollview+mylayout的结构中使用tableview,列表不加载。。。

代码: 1:tableview UITableView *table = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; [self.contentLayout addSubview:table]; table.rowHeight = 44; table.myLeft = 0; table.myRight = 0; //设置初始高度,是因为初始化的高度不够高的话,可以较多的cell就不会触发加载 table.myHeight = MAXFLOAT; table.wrapContentHeight = YES; table.delegate = self; table.dataSource = self; self.tableview = table;

2:cell 用的系统默认的cell

问题: numberOfRowsInSection,heightForRowAtIndexPath触发了。 cellForRowAtIndexPath 不会触发

zhaoyongjiang avatar May 13 '20 04:05 zhaoyongjiang

  1. 对于tableview来说目前不支持wrapContentHeight。试想一下,tableview本来就是用来复用的。如果你都高度自适应了,还怎么有复用的意义。 2.出现这个问题时,建议你看看你的视图树是否是某个高度或者宽度为0导致的cell不刷新。 3.如果还有其他问题建议你加入群:178573773 来讨论,因为你的问题描述无法给你做够的改进建议。

youngsoft avatar May 13 '20 08:05 youngsoft

群满员了~

Jentlezhi avatar Jun 20 '20 09:06 Jentlezhi