隐藏活动指标 [英] Hide activity indicator

查看:85
本文介绍了隐藏活动指标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以在我的主要故事板中,我创建了一个活动指标。

so in my main storyboard i created a Activity Indicator.

我希望隐藏我的活动指示器,直到按下按钮。
有没有办法可以做到这一点?

ANd i want to hide my activity indicator until the button has been pressed. Is there a way i can do that?

这是我的代码,
当我按下按钮时,活动指示器启动animatig。

Here is my code, when i press the button the activity indicator starts animatig.

self.indicator.hidden = NO;
[self.indicator startAnimating];
[self performSelector:@selector(showData) withObject:nil afterDelay:2.0f];

所以问题再一次,我可以隐藏活动指示器,直到按下按钮然后它会显示此活动指示器。

So the question again, can i hide the activity indicator until the button has been pressed and then it will show this activity indicator.

推荐答案

在故事板中选择活动指示器,然后选择属性停止时隐藏。这样您就不必隐藏它,只需启动或停止动画,活动指示器将自动显示和隐藏。当然,你仍然需要添加代码来启动和停止动画到按钮。

Select the Activity Indicator in Storyboard, then select property "Hides when stopped". This way you don't have to hide it, just start or stop the animation, and the Activity Indicator will show and hide automatically. Of course, you still have to add the code to start and stop the animation to buttons.

这篇关于隐藏活动指标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆