【发布时间】:2018-01-31 13:16:04
【问题描述】:
我在捏手势期间使用 CATransform3DMakeScale 调用来调整 CALayer 的大小,但每个转换调用都会从原始比例动画到目标比例。
由于我将捏合手势比例的值传递给变换调用,因此手势比例值的更新速度比导致卡顿的变换动画快。
- (void)handlePinchGesture:(UIPinchGestureRecognizer *)gestureRecognizer {
if ([gestureRecognizer state] == UIGestureRecognizerStateChanged) {
pinchScale = [gestureRecognizer scale];
CALayer *layer = [self layer];
/* During pinching, this gets called again during the animation
of the last transformation */
layer.transform = CATransform3DMakeScale(pinchScale, pinchScale, 0);
}
}
如何阻止CATransform3DMakeScale 为转换设置动画?
【问题讨论】:
标签: ios objective-c animation calayer scaletransform