在 Android 版 Titanium 中动态加载表格视图内容
我正在创建一个使用 Google Books API 的应用程序。因此,每当我搜索一本书时,它都会给出 JSON 响应,并将这些结果加载到表视图中。当我搜索时,会有数千本书的结果。但我不想在我的表格视图中加载所有内容。每当我向下滚动时,它只需要加载下一本书。
谁能给我一个关于如何使用 Titanium 在 Android 中执行此操作的代码或粗略想法?我检查了这篇文章: https://github.com/appcelerator /KitchenSink/blob/master/Resources/examples/table_view_dynamic_scroll.js 但这是针对 iPhone 的,我也需要它用于 Android。帮帮我吧...
I am creating an appliction which uses Google Books API. So whenever I search a book it gives a JSON response and I load those results in my table view. There will be thousands of books results when I search. But I don't want to load everything in my tableview. Whenever I scroll down it only has to load next books.
Can anyone give me a code or rough idea on how to do this in Android using Titanium? I have checked this post: https://github.com/appcelerator/KitchenSink/blob/master/Resources/examples/table_view_dynamic_scroll.js But this is for iPhone, I need it for Android as well. Help me out...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
环顾四周后,我为 android 实现了以下解决方案:
其中
e.source.__pageSize
、e.source.__doneUpdating
和e.source.__updating
> 是由将行插入 tableView 的代码维护的内部变量。After looking around I have implemented following solution for android:
Where
e.source.__pageSize
,e.source.__doneUpdating
, ande.source.__updating
are internal variables that are maintained by the code inserting rows into the tableView.