Hide activity indicator in status bar [duplicate]

馋奶兔 提交于 2019-12-25 17:07:16

问题


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?

I am using following code:

UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = NO;
[self connectserver];

Before connecting to server I am hiding the indicator but it's not working.


回答1:


you can call this method of activity indicator:

[app.networkActivityIndicator stopAnimating];

and if activity indicator is on superview the you have to remove it from superView:

[app.networkActivityIndicator removeFromSuperView];

Hope this might help.




回答2:


try this

    [UIApplication sharedApplication].networkActivityIndicatorVisible=FALSE;

and also check whether you make it visible somewhere else or not.



来源:https://stackoverflow.com/questions/17081003/hide-activity-indicator-in-status-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!