我目前呈现视图的可见部分的PNG,像这样:如何呈现视图及其子视图的交集?
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, [UIScreen mainScreen].scale);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
视图有一个子视图名为ImageView的(和其他一些);我想呈现与imageView相交的视图的可见部分(包括其他子视图)。我正在寻找使用UIRectClip
,但我得到非常奇怪的结果。如何渲染视图和其子视图的交集?