How to implement a loading animation when navigating in a iPhone app?

前端 未结 7 1917
情歌与酒
情歌与酒 2021-02-04 18:41

It seems like a pretty simple problem, but I have been unable to find any good answers.

What I\'m trying to do is to make some sort of animation while some function is l

7条回答
  •  日久生厌
    2021-02-04 18:48

    I guess it depends on what is being loaded? Are you waiting for a response from a server? In that case I usually put a spinning wheel (UIActivityIndicatorView) on my view that has the hide when not animating checkbox checked (there is a message to set this programmatically as well). Then when the data is received from the server I simply call stopAnimating on the UIActivityIndicator view and it will hide. You can then show whatever it is you need to show.

提交回复
热议问题