Honeycomb 中的片段加载旋转器/对话框
将数据加载到我的片段中时,我希望在片段中间有一个不确定的旋转器(下图中的示例),以向用户显示内容正在该特定窗格中加载。
在蜂窝中执行此操作的最佳方法是什么?
我真的不想在操作栏中使用微调器,因为加载数据的位置并不是很明显。另外,我不想要一个不确定的进度对话框,因为它出现在整个应用程序的中心,并且还会阻止用户执行任何其他操作,直到它被关闭。 NB FragmentDialogs 似乎也这样做。
我是否必须使用自定义 FrameLayout 才能获得每个窗格所需的效果?
When loading data into my Fragments I would would like to have an indeterminate spinner in the middle of the fragment (example in pic below) to show the user that content is loading within that particular pane.
What's the best way to do this in Honeycomb?
I don't really want to use a spinner in the action bar, it's not immediately obvious where data is loading. Also, I don't want an indeterminate progress dialog because it appears in the center of the entire app and also stops the user from doing anything else until it is dismissed. N.B. FragmentDialogs seem to do this also.
Am I going to have to hack around with a custom FrameLayout to get the desired effect for each pane?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是
ListFragment
,则可以调用setListShown(false)
来显示加载进度指示器,直到您调用setListShown(true)
。您可以在片段的Loader
回调方法中调用这些方法,以在加载列表时显示指示器。If you're using a
ListFragment
you can callsetListShown(false)
to display a loading progress indicator until you callsetListShown(true)
. You can call these in the fragment'sLoader
callback methods to show the indicator while the list is loading.我认为实现这一点的最佳方法是使用 ViewSwitcher。然后,如果您使用加载器,则可以在加载完成后在视图(加载视图和内容视图)之间切换。
I think the best way to accomplish this would be to use a ViewSwitcher. Then if you are using a loader, you can just switch between the views (the loading view and the content view) after the load has been completed.