iOS translation and scale animation

前端 未结 4 925
日久生厌
日久生厌 2020-12-08 03:12

I\'m working on UIButton animation where:

The UIButton is set in the bottom center of the screen and scaled to a small size

_menuBtn.tra         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 03:40

    This has solved a similar problem.

    Apply a (UIButton).imageView Animation.

    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDuration:5];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
    CGAffineTransform scaleTrans  = CGAffineTransformMakeScale(1.0f, 1.0f);
    CGAffineTransform lefttorightTrans  = CGAffineTransformMakeTranslation(-200.0f,0.0f);
    _menuBtn.imageView.transform = CGAffineTransformConcat(scaleTrans, lefttorightTrans);
    [UIView commitAnimations];
    

提交回复
热议问题