网络活动指示器应该始终处于活动状态吗?
我正在 iphone 项目中使用网络活动指示器。问题是,即使我的应用程序中没有发送和接收,指示器也会旋转,并且仅在网络断开连接时停止。
任何人都可以告诉它是因为任何隐藏的活动或网络活动指示器行为都是这样的!对于这个问题你有什么解决办法吗?
我需要通知我的用户有关网络活动的信息...
编辑:问题是我不确定网络活动指示器的使用情况,或者换句话说,我不知道网络活动何时旋转,这是否意味着存在活动或只是显示连接未断开!
谢谢
I am using network activity indicator in an iphone project . the problem is even when there is no send and receive in my app the indicator is spinning and only stops when network is disconnected .
Can anyone tell is it because of any hidden activity or network activity indicator behavior is like this !!! Do you have any solution for this problem ?
I need to inform my user about network activity ....
EDIT : the problem is I am not sure about the usage of Network activity indicator, or in other word I dont know when the network activity is spinning , does it mean there is an activity or just it shows the connection is not down !
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
网络活动指示器可以这样隐藏:
The network activity indicator can be hidden like that:
查看将活动设置为旋转的位置以及将其关闭的位置。您的呼叫似乎不平衡。
手动打开和关闭它的另一种方法是使用辅助类,例如 DCTNetworkActivityIndicatorController ,您可以在其中递增和递减调用微调器而不仅仅是打开和关闭它,这是显示活动的更可靠的方式。
Have a look at where you are setting the activity to spinning and where you are turning it off. It looks like you have unbalanced calls.
An alternative to manually turning it on and off is to use a helper class such as DCTNetworkActivityIndicatorController where you increment and decrement calls to the spinner instead of just turning it on and off, and this is a much more robust way of showing activity.
我从这个网站找到了这个问题的答案:
http://iosdevelopertips。 com/cocoa/showing-network-activity-when-there-isn%E2%80%99t-any.html
// 启动指标 ...
[UIApplication共享应用程序].networkActivityIndicatorVisible = YES;
// 做一些可能需要一些时间才能完成的事情...
// 停止指标...
[UIApplication共享应用程序].networkActivityIndicatorVisible = NO;
I Found the answer for this problem from this website :
http://iosdevelopertips.com/cocoa/showing-network-activity-when-there-isn%E2%80%99t-any.html
// start the indicator ...
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
// Do something that may take some time to complete ...
// stop the indicator ...
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
如果您使用 UIWebView,您是否实现了
}
和
?
In case you use a UIWebView, did you implement
}
and
?