镂空效果

2021-10-20  本文已影响0人  风吹柳絮如花落

镂空效果

        let bpath = UIBezierPath.init(rect: self.bounds)
        bpath.append(UIBezierPath.init(roundedRect: CGRect.init(x: 1, y: 16, width: self.width - 2, height: self.height - 32), cornerRadius: 8).reversing())
        let layer = CAShapeLayer.init()
        layer.path = bpath.cgPath
        self.layer.mask = layer
上一篇 下一篇

猜你喜欢

热点阅读