用 Label 标记的 UIImage
这会使图像蒙版为标签字母的形状:
Objective-C
self.maskImage.layer.mask = self.maskLabel.layer;
self.maskImage.layer.masksToBounds = YES;
Swift 3
maskImageView.mask = maskLabel
maskImageView.masksToBounds = true
结果如下:
这会使图像蒙版为标签字母的形状:
self.maskImage.layer.mask = self.maskLabel.layer;
self.maskImage.layer.masksToBounds = YES;
maskImageView.mask = maskLabel
maskImageView.masksToBounds = true
结果如下: