开发者

how to display an image and hide it in the animation function?

I want the image to be displayed and then hide and so on. I have tried nil and blank with out success. How can I accomplish this?

-(void) ani开发者_如何学编程mationGlaw {

    glawBall.animationImages = [NSArray arrayWithObjects:
                                 [UIImage imageNamed:@"1.png"],
                                 [UIImage imageNamed:@""], nil];
    glawBall.animationDuration = 0.50;
    glawBall.animationRepeatCount = 0;
    [glawBall startAnimating];

}


if you only want one image then none, you could try animating the opacity, and diong the animation very fast. If a fade out is acceptable then this would work even better. here is an example of animating the opacity.

you could also use the delegate to get notification when your animation ends and remove the image altogether, see here for an example of using the animationDidStop:finished: callback method.


Try using just a transparent PNG for the final image.


What I do is I just set height and width of image to 0.. Like this

[myImageView setFrame:CGRectMake(myX, myY, 0, 0)];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜