84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
一个背景黑色50%透明,中间镂空一个全透明的区域该怎么弄?
业精于勤,荒于嬉;行成于思,毁于随。
绘制View的时候用layer.mask给layer加个图片蒙版(可以做一张灰白图片,黑色显示,白色不显示,灰色代表半透明)。
全透明的UIView上盖一层半透明的中间镂空的图片不就好了
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
绘制View的时候用layer.mask给layer加个图片蒙版(可以做一张灰白图片,黑色显示,白色不显示,灰色代表半透明)。
全透明的UIView上盖一层半透明的中间镂空的图片不就好了
let path = UIBezierPath(rect:self.view.bounds)