如何显示活动指示器

发布于 2024-11-07 20:43:30 字数 104 浏览 0 评论 0原文

单击登录屏幕中的登录按钮后,我需要显示一个透明视图,中间有活动指示器(旋转),一段时间后,该视图应该消失,并且应该加载下一个视图。

请在这方面帮助我

谢谢 里兹万

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

空宴 2024-11-14 20:43:30

在视图中间放置一个活动指示器视图,选择其样式使其可见(白色或灰色),选择“停止时隐藏”,调用:

[activity startAnimating];

activityView 将可见并具有动画效果。然后做任何你想做的事情,调用 NSTimer 或其他什么,当计时器被触发或你的操作完成时 clal:

[activity stopAnimating];

活动视图将停止旋转并隐藏。

除了使用库存活动指示器视图之外,您还可以在 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:

[activity startAnimating];

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:

[activity stopAnimating];

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.

忱杏 2024-11-14 20:43:30

我假设您将使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文