How can I change the UIActivityIndicatorView to set a custom image?

不想你离开。 提交于 2019-12-06 13:55:05

问题


Well, I am looking for a way to change my spinner image and use a custom image

Any suggestion?


回答1:


I have created a subclass of UIActivityIndicatorView that allows you to set a custom image.




回答2:


You could simply use a UIImageView and add an animation that rotates the view's layer indefinitely. You can achieve this using CoreAnimation. There are plenty of tutorials for this out there.

If you wish to start and stop the animation you can create a simple subclass of UIImageView that adds and removes said animation.

Here's a link for the animation: Basic keyframe animation (rotation)



来源:https://stackoverflow.com/questions/10171152/how-can-i-change-the-uiactivityindicatorview-to-set-a-custom-image

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