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

缓存 #18

Closed
FaDeve opened this issue Nov 8, 2018 · 8 comments
Closed

缓存 #18

FaDeve opened this issue Nov 8, 2018 · 8 comments

Comments

@FaDeve
Copy link

FaDeve commented Nov 8, 2018

有五个item,直接点击第五个,会看到中间的界面,如果有很多个item,会不会很占用内存

@pujiaxin33
Copy link
Owner

1、如果你不想要点击之后,会看到中间的页面。可以直接切换过去,没有中间动画,参考下面:
你可以实现下面的代理方法进行自定义:

- (void)categoryView:(JXCategoryBaseView *)categoryView contentScrollViewTransitionToIndex:(NSInteger)index

具体可以看里面的API注解
2、关于内存问题
参考这个关于视图全部加载问题

@FaDeve
Copy link
Author

FaDeve commented Nov 9, 2018 via email

@pujiaxin33
Copy link
Owner

是的,中间的item,虽然初始化了,但是没有加载数据,内存消耗不大

@FaDeve
Copy link
Author

FaDeve commented Nov 9, 2018 via email

@pujiaxin33
Copy link
Owner

1、一个页面你没有去触发的它的加载,它始终只是一个空壳VC。内存消耗不大。
2、如果一个VC加载了,那么你只能让它常驻内存,需要保留状态,用户再次切换过的时候,还是之前的状态。

@pujiaxin33
Copy link
Owner

就是说,最开始VC,就只是一个空的VC,不要在viewdidload里面去加载。而是用户滚动到该页面,或者点击滚动到该页面,才触发加载的逻辑。

@pujiaxin33
Copy link
Owner

实在担心内存问题。目前只有自己改造一下,只有vc真正出现的时候,才去创建它。我们有这么做,是我觉得,内存应该不会是主要问题。

@pujiaxin33
Copy link
Owner

感谢你的反馈,1.0.0版本实现了列表懒加载。等到列表显示的时候,才会真正初始化。欢迎使用最新版本体验!!!

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