(隐式动画就是在layer上的视图移动的时候有一个移动过程的动画效果,系统默认的,动画时间是0.25秒,如果关闭隐式动画,直接就跳到点击的位置,忽入忽出的,感觉比较生硬)
没有隐式动画的时候
//添加layer层
_layer = [[CALayer alloc] init];
_layer.position = CGPointMake(100, 100);
_layer.bounds = CGRectMake(0, 0, 200, 200);
_layer.backgroundColor = [UIColor redColor].CGColor;
[self.view.layer addSublayer:_layer];
点击的时候添加隐式动画
//隐式动画
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
// 取得点击的touch
UITouch * touch = [touches anyObject];
// 取得点击的位置
CGPoint point = [touch locationInView:self.view];
// 隐式动画(开启)
[CATransaction begin];
// 关闭隐