在appcelerator中使用headerPullView
我正在使用带有 headerPullView 的 tableView 。 它工作正常,但我想在打开选项卡时显示 headerPullView,以便用户可以看到新数据已加载。
在 google 或 appcelerator 文档上找不到任何信息。
我只找到了这个: http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html 但这仅显示了选项卡已加载时如何更新。我正在寻找一种方法来显示当我打开该窗口时加载 headerPullView 。
I'm using a tableView with a headerPullView.
It works fine, but i want to show the headerPullView when i open the tab so the user can see that new data is loaded.
Can't find any information on google or appcelerator docs.
I only found this: http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html
but this only shows how to update when the tab is already loaded. I'm looking for a way to show that loading headerPullView when i open that window.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法使用
headerPullView
模拟滚动,但可以触发scroll
事件。无论如何,我建议创建一个
headerView
并将表格高度设置得更小并远离顶部。将侦听器附加到open
事件。然后,当您第一次滚动表格时,只需将其全部设置回您需要的方式即可。
但我不太确定为什么你需要这样做。在 Facebook 用这种方法取代“摇动刷新”之后,我开始在几乎所有桌面应用程序中看到它,并且开始期待它。我想很多其他用户对此也有同样的感觉吧?
You can't simulate a scroll with the
headerPullView
but you can fire an event ofscroll
.Anyways what I would advise is to create a
headerView
and set the table height smaller and away from the top. Attache a listener to theopen
event.Then just set it all back the way you need it when you scroll the table the first time.
I'm not so sure why you need to do this however. After facebook replaced "shake to refresh" with this method I've started seeing it in almost all table apps and have come to just expect it. I assume many other users feel the same way about this?
你可以使用listView代替tableView,它支持拉视图已经
检查过
http://docs.appcelerator.com/titanium/ 3.0/#!/guide/ListViews-section-37521650_ListViews-PulltoRefresh
或者你可以使用这个模块
https://github.com/jolicode/Alloy-PullToRefresh
you can use listView instead of tableView, it supports pull view already
check this
http://docs.appcelerator.com/titanium/3.0/#!/guide/ListViews-section-37521650_ListViews-PulltoRefresh
or you can use this modules
https://github.com/jolicode/Alloy-PullToRefresh