UIView with transparent in middle
问题 Is it possible to create such a UIView fill with color, but in the middle is transparent? I'm thinking about to create 5 UIView s here. Just wondering is it possible to accomplish by using only ONE UIView 回答1: From Duncan C, I get to know where should I start, then I found CALayer with transparent hole in it. UIBezierPath *overlayPath = [UIBezierPath bezierPathWithRect:self.view.bounds]; UIBezierPath *transparentPath = [UIBezierPath bezierPathWithRect:CGRectMake(60, 120, 200, 200)];