84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
一个背景黑色50%透明,中间镂空一个全透明的区域该怎么弄?
业精于勤,荒于嬉;行成于思,毁于随。
When drawing View, use layer.mask to add a picture mask to the layer (you can make a gray and white picture, black is displayed, white is not displayed, and gray represents translucency).
Wouldn’t it be nice to cover a fully transparent UIView with a translucent picture with a hollow in the middle
let path = UIBezierPath(rect:self.view.bounds)
path.appendPath(UIBezierPath(rect: CGRect(x: 100, y: 100, width: 200, height: 300)).bezierPathByReversingPath()) let shape = CAShapeLayer() shape.path = path.CGPath blurView.layer.mask = shape
When drawing View, use layer.mask to add a picture mask to the layer (you can make a gray and white picture, black is displayed, white is not displayed, and gray represents translucency).
Wouldn’t it be nice to cover a fully transparent UIView with a translucent picture with a hollow in the middle
let path = UIBezierPath(rect:self.view.bounds)