【发布时间】:2019-05-28 20:49:11
【问题描述】:
我想混合多个 UIView,使其可以平滑移动、旋转和调整大小。
我已经使用下面的代码实现了这一点,但它不如 PicsArt 和 SnapSeed 等其他应用程序流畅。
- (void)drawRect:(CGRect)rect {
// Drawing code
[super drawRect:rect];
UIImage *viewImage = [self captureView:self.superview withFrame:self.frame];
[viewImage drawInRect:rect];
[self.imageToBlend drawInRect:rect blendMode:self.blendMode alpha:self.alphaBlend];
// Other code....
}
【问题讨论】:
-
我想我没有得到你的问题,你为什么不使用 CGAffineTransform?如果您在托管视图上应用旋转、平移,它会自动在其中混合子视图,Core Animation 将硬件加速一切
标签: ios objective-c uiview blend