remove一个view的时候并且添加动画
2016-12-13 本文已影响40人
Easy_VO
好久没写笔记了,都是直接用Day One直接记录.发现想网易云笔记,Day One这种真的很好用,随时随地的抓出来.
惯例,记录一下项目中的一些技巧或者知识吧.
removeFromSuperview
时候添加动画
CATransition *transition = [CATransition animation];
transition.duration = 1.0f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
transition.type = kCATransitionFade;//{kCATransitionMoveIn, kCATransitionPush, kCATransitionReveal, kCATransitionFade};
//其它动作{@"cube",@"suckEffect",@"oglFlip",@"rippleEffect",@"pageCurl",@"pageUnCurl",@"cameraIrisHollowOpen",@"cameraIrisHollowClose"};
// transition.subtype = kCATransitionFade;//{kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom};
transition.delegate = self;
[sb.layer.superlayer addAnimation:transition forKey:nil];
[sb.layer addAnimation:transition forKey:nil];
//[self performSelector:<a href="http://www.twitter.com/selector">@selector</a>(removeFromView)];
//[self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
[sb removeFromSuperview];
sb = nil;
最近一个月的确被项目追的很忙, 心情有些不好.希望码兄码弟们也提醒自己,工作虽忙调整心态,毕竟年后你懂得.