[Objective-C] ios View 淡入淡出效果 →→→→→进入此内容的聊天室

来自 , 2020-07-03, 写在 Objective-C, 查看 173 次.
URL http://www.code666.cn/view/bcc2bdb7
  1. - (void)TheAnimation{
  2.      
  3.     CATransition *animation = [CATransition animation];
  4.     animation.delegate = self;
  5.     animation.duration = 0.7// 动画持续时间(秒)
  6.     animation.timingFunction = UIViewAnimationCurveEaseInOut;
  7.     animation.type = kCATransitionFade;//淡入淡出效果
  8.      
  9.     NSUInteger f = [[rView subviews] indexOfObject:fView];
  10.     NSUInteger z = [[rView subviews] indexOfObject:zView];
  11.     [rView exchangeSubviewAtIndex:z withSubviewAtIndex:f];
  12.      
  13.     [[rView layer] addAnimation:animation forKey:@"animation"];
  14.      
  15.     [self performSelector:@selector(ToUpSide) withObject:nil afterDelay:2];//2秒后执行TheAnimation
  16. }
  17. //objectc/5844

回复 "ios View 淡入淡出效果"

这儿你可以回复上面这条便签

captcha