我有一个NSScrollView,想把它缩小50%。我使用以下代码实现:
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
animation.fromValue = [NSNumber numberWithFloat:1.00];
animation.toValue = [NSNumber numberWithFloat:0.50];
[animation setDuration:0.20f];
[animation setFillMode:kCAFillModeForwards];
[animation setRemovedOnCompletion:NO];
[self.scrollView.layer addAnimation:animation forKey:@"drag"];
这可以实现,但当我在缩小的视图范围之外单击时,滚动视图的文档视图会接收鼠标按下事件。因此,尽管滚动视图及其内容在视觉上看起来被缩小了,但它们在技术上并没有被缩小。
我该怎么做呢?
谢谢!