Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zhaoyongjiang opened this issue May 13, 2020 · 2 comments
Open

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

zhaoyongjiang opened this issue May 13, 2020 · 2 comments

Comments

@zhaoyongjiang
Copy link

一:我是在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 不会触发

@youngsoft
Copy link
Owner

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

@Jentlezhi
Copy link

群满员了~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants