【转】淡入淡出效果的实现

 

//淡入淡出效果
- (void) appear
{
    CGContextRef contextf = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:nil context:contextf];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [paintToolView setAlpha:1.0];
    [UIView setAnimationDuration:4.0f];
    [UIView commitAnimations];
}

- (void) disappear
{
    CGContextRef contextf = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:nil context:contextf];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:1.0];
    [paintToolView setAlpha:0.0f];
    [UIView commitAnimations];
}
动画是否正常演示出,跟调用处的上下文有很大的关系。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-04-03
  • 2021-06-24
猜你喜欢
  • 2021-06-15
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-05-19
  • 2022-12-23
相关资源
相似解决方案