// 展开动画
- (void)beginAnimations
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:nil context:context];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:0.6];//动画时间长度,单位秒,浮点数
    myView.frame = CGRectMake(0, 0, 320, 110);
    [UIView commitAnimations];
}

// 收起动画
- (void)endAnimations
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:nil context:context];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:0.6];//动画时间长度,单位秒,浮点数
    myView.frame = CGRectMake(0, -110, 320, 110);
    [UIView commitAnimations];
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-09-07
  • 2021-08-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2021-11-15
  • 2021-04-19
  • 2021-11-29
  • 2022-12-23
相关资源
相似解决方案