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

是不是添加子控制器视图作为item比较好一些? #1

Open
lcddhr opened this issue Jul 16, 2015 · 1 comment
Open

是不是添加子控制器视图作为item比较好一些? #1

lcddhr opened this issue Jul 16, 2015 · 1 comment

Comments

@lcddhr
Copy link

lcddhr commented Jul 16, 2015

如果视图要刷新调用reloadData方法,tableView的所有cell都会被刷新一次,还是用自子控制器作为item会好一些

@fergusding
Copy link
Owner

之前有用自控制器视图作为item,不过没有优化。因为这样你必须实现重用和内存管理的优化,然后采用tableview只是借用了它的优势。reloadData不会刷新所有cell吧,应该会调用numberOfRowsInSection和cellForRowAtIndexPath方法,但是第二个方法只会加载visible的cell,在这个项目里visible的cell个数为1。另外这种滑动场景应该是不会调用reloadData。

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

2 participants