We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
请问在TangramFlowLayout布局中的calculateLayout方法中有以下一段代码,是否是可以使用的呢?
if ((self.loadType == TangramLayoutLoadTypeLoadOnce || self.loadType == TangramLayoutLoadTypeByPage) && self.loadAPI.length > 0) { TangramEvent *loadEvent = [[TangramEvent alloc]initWithTopic:@"requestItems" withTangramView:self.tangramView posterIdentifier:@"requestItems" andPoster:self]; [loadEvent setParam:self.loadAPI forKey:@"loadAPI"]; [loadEvent setParam:[NSNumber numberWithInteger:self.loadType] forKey:@"loadType"]; if (self.loadParams.count > 0) { [loadEvent setParam:self.loadParams forKey:@"loadParams"]; } [self.tangramBus postEvent:loadEvent]; }
我在外部注册了该事件的监听,实现了网络请求、回调后刷新数据源,然后[tangramView reloadData],但是在reloadData方法中又会去调用TangramFlowLayout的calculateLayout方法,然后就死循环了。请问怎样可以避免呢?
The text was updated successfully, but these errors were encountered:
这个方法应该被归类为不推荐使用的将废弃方法,这是我们在业务中为了实现首次进入 TangramFlowLayout 时进行一次状态请求的后门,后期维护时可能会从开源版本中移除。
如果您想了解具体的细节的话:
Sorry, something went wrong.
安卓版本也有这几个字段,我理解他的作用是,异步请求卡片的内容数据。这个功能应该不会去除吧?
异步加载数据一方面来说比较倾向于业务逻辑,而不是底层框架特性。框架可以在合适的时机抛出 didEnter / didLoaded 等事件供业务层来进行对应功能扩展。
另一方面至少从设计角度来说,不太应该在 calculateLayout 方法中进行数据请求的 Bus 事件发送。
calculateLayout
好的,我这里参照安卓,在Tangram的scrollViewDidScroll方法中遍历了visibel layouts,对设置了loadApi的layout发出了asyncload的event,由业务方处理该event。
No branches or pull requests
请问在TangramFlowLayout布局中的calculateLayout方法中有以下一段代码,是否是可以使用的呢?
我在外部注册了该事件的监听,实现了网络请求、回调后刷新数据源,然后[tangramView reloadData],但是在reloadData方法中又会去调用TangramFlowLayout的calculateLayout方法,然后就死循环了。请问怎样可以避免呢?
The text was updated successfully, but these errors were encountered: