How to use a image instead of activity indicator?

本小妞迷上赌 提交于 2019-12-24 17:19:15

问题


in my app when i click on refresh button, an activity indicator appears. and when tableView is refreshed then it disappears. i want to use a image instead of that activity indicator in such a way that when i click on refresh that image ll come on the whole screen and when view ll b refreshed it ll disappear. how can i do that? thanx in advance


回答1:


Basically what you need to do is add a "cover page" view over your current view.

These usually work best if you set the alpha to about 50%.

Hitting the button you can call addSubview:coverPage where you init coverPage somewhere with the right attributes.

If you want, cover page can have it's own spinners or labels if necessary.

after your refresh completes, just call [coverPage removeFromSuperview] to dismiss.




回答2:


UIActivityIndicatorView is the spinning thing that is the default busy indicator. It inherits from UIView. If you subclass it and have your own drawRect: implementation you should be able to draw any image you like in place of the spinning bars.



来源:https://stackoverflow.com/questions/5130590/how-to-use-a-image-instead-of-activity-indicator

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