开发者

iPhone : UIVIew Boing kind of animation

Sorry for the poor title, I am trying to think of a easy way to explain this.

I have a UIView in the center of the screen which contains a progress indicator and background image.

What I want it to do开发者_Python百科 is get bigger to a certain point and then shrink a tiny bit. So it "boings" in.

I had a play with normal UIView animations etc and have it coming in. However I thinking to get this to work well I need to use the views layer. The main issue at the moment is the indicator does not size.

Has anyone done a boing effect on a view?


Something like this?

- (void)boingView:(UIView *)theView {
    [UIView animateWithDuration:0.1 animations:^(void) {
        theView.transform = CGAffineTransformMakeScale(1.3, 1.3);        
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.1 animations:^(void) {
            theView.transform = CGAffineTransformMakeScale(0.8, 0.8);        
        } completion:^(BOOL finished) {
            [UIView animateWithDuration:0.1 animations:^(void) {
                theView.transform = CGAffineTransformMakeScale(1.0, 1.0);        
            } completion:nil];                    
        }];        
    }];
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜