Pausing animated UIImages?

Discussion in 'iOS Programming' started by Danneman101, May 28, 2009.

  1. Danneman101 macrumors 6502

    Joined:
    Aug 14, 2008
    #1
    Ive got a UIImage that is animated with 26 images in a perpetual loop.

    On top of that, the image is accelerated (when tilting the iphone, the imaged goes to the right or the left).

    I want to be able to pause and resume the animation by the press of a button, but I cant find a pause-function for animated uiimages.

    The problem with [myImage stopAnimating]; is that the image disappears completely - I need it to stay on the screen.

    I could probably put another static image with the correct image-frame in the position where the animation was last, but that would be an awful lot of work compared to a pause-function...
     
  2. jnic macrumors 6502a

    Joined:
    Oct 24, 2008
    Location:
    Cambridge
    #2
    If you set the UIImageView's image property then that'll be the image you see when you call stopAnimating.
     
  3. Danneman101 thread starter macrumors 6502

    Joined:
    Aug 14, 2008
    #3
    Thanks - that helped for the stop-part. For restart Im just getting the location of the stopped image, remove it, and then make a new one.
     

Share This Page