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

自古美人都是妖i 提交于 2019-12-04 20:03:38

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

Felix Lamouroux

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)

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