美文网首页
swift 切指定的圆角UIRectCorner

swift 切指定的圆角UIRectCorner

作者: Dove_iOS | 来源:发表于2019-03-18 16:12 被阅读0次
    let maskPath = UIBezierPath(roundedRect: bounds, 
    byRoundingCorners: [.topLeft, .topRight], cornerRadii:CGSize(width:10, height:10))
    
    let masklayer = CAShapeLayer()
    masklayer.frame = bounds
    masklayer.path = maskPath.cgPath
    cell?.layer.mask = masklayer
    

    *bounds是重点,赋值错误会有UI上的bug

    相关文章

      网友评论

          本文标题:swift 切指定的圆角UIRectCorner

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