美文网首页
iOS app 内 引导图 镂空

iOS app 内 引导图 镂空

作者: 小白lf | 来源:发表于2021-01-25 16:05 被阅读0次
let testv = UIView()
     testv.frame = UIScreen.main.bounds
     testv.backgroundColor = UIColor.black.withAlphaComponent(0.5)
     UIApplication.shared.keyWindow?.addSubview(testv)
        
     let path = UIBezierPath.init(rect: testv.bounds)
     let fame = self.view.convert(btnOpenMini.frame, to: UIApplication.shared.keyWindow)
     let path1 = UIBezierPath.init(roundedRect: fame.insetBy(dx: -5, dy: -5), cornerRadius: 3)
     path.append(path1)
        
     let shape = CAShapeLayer()
     shape.path = path.cgPath
     shape.fillRule = .evenOdd
        
     testv.layer.mask = shape

相关文章

网友评论

      本文标题:iOS app 内 引导图 镂空

      本文链接:https://www.haomeiwen.com/subject/xqhizktx.html