隐藏状态栏中的活动指示器 [英] Hide activity indicator in status bar
问题描述
我正在使用pull to刷新表,并且在pull to refresh table中已经有一个活动指示器。当我拉桌子然后调用Web服务时,状态栏中的活动指示器出现,但我想在整个应用程序的状态栏中隐藏指示器。当我连接webservice时,我甚至不想显示网络指示器。我该怎么做?
I am using pull to refresh table and in pull to refresh table there is already a activity indicator. And when I pull the table then calling a web service then the activity indicator in status bar appears, but I want to hide the indicator in status bar in whole app. When I am connecting with webservice even then I don't want to show the network indicator. How can I do this?
我使用以下代码:
UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = NO;
[self connectserver];
在连接到服务器之前我隐藏了指标,但它无法正常工作。
Before connecting to server I am hiding the indicator but it's not working.
推荐答案
你可以调用这种活动方法指标:
you can call this method of activity indicator:
[app.networkActivityIndicator stopAnimating];
如果活动指示器在superview上,你必须从superView中删除它:
and if activity indicator is on superview the you have to remove it from superView:
[app.networkActivityIndicator removeFromSuperView];
希望这可能有所帮助。
这篇关于隐藏状态栏中的活动指示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!