如何显示活动指示器
单击登录屏幕中的登录按钮后,我需要显示一个透明视图,中间有活动指示器(旋转),一段时间后,该视图应该消失,并且应该加载下一个视图。
请在这方面帮助我
谢谢 里兹万
After clicking the Login Button in the login screen i need to display a transparent View with activity indicator in the middle(spinning) and after some time that should disappear and the next view should be loaded.
please help me in this aspect
thanks
rizwan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在视图中间放置一个活动指示器视图,选择其样式使其可见(白色或灰色),选择“停止时隐藏”,调用:
activityView 将可见并具有动画效果。然后做任何你想做的事情,调用 NSTimer 或其他什么,当计时器被触发或你的操作完成时 clal:
活动视图将停止旋转并隐藏。
除了使用库存活动指示器视图之外,您还可以在 www.cocoacontrols.com 上找到有用的控件,例如 MBProgressHUD 的屏幕截图看起来也是您想要执行的操作的候选者。
Place an Activity Indicator View in the middle of the view, selects its style so that it is visible (white or grey), select "hides when stopped", call:
the activityView will be visible and animating. Then do whatever you want to do, call NSTimer or whatever and when the timer get triggered or your action is finished clal:
and the activity view will stop spinning and hide.
Other than using the stock Activity Indicator View you may find useful controls on www.cocoacontrols.com, for exmaple MBProgressHUD's screenshot looks like it were also a candidate for what you want to do.
我假设您将使用 ajax 进行登录和后端服务器端脚本。
您将在 Apple SDK 库 Interface Builder 中找到“旋转活动指示器”,如评论中所述。
一旦您的 Ajax 调用完成 - 您就在等待响应。只需显示活动指示器,直到收到服务器的响应。
然后,在完成加载“下一个视图”的处理后,只需将其隐藏即可。
我无法给你确切的答案,因为你的问题缺乏太多细节。
I assume you'll be using ajax for the login and a back-end server side script.
You'll find the "spinning activity indicator" thing in the Apple SDK library Interface Builder as referred to in the comment.
Once your Ajax call has been made - you are waiting for a response. Simply display the activity indicator until you get a response from the server.
Then simply hide it once you have done your processing to load the "next view".
I can't give you an exact answer because your question lacks too much detail.