美文网首页
Swift 顶部分隔线

Swift 顶部分隔线

作者: LevyHoo | 来源:发表于2018-08-16 10:32 被阅读0次


    overridefuncdraw(_rect:CGRect) {

        guard let context = UIGraphicsGetCurrentContext() else {

            return

        }

        context.setStrokeColor(red:198/255.0, green:198/255.0, blue:198/255.0, alpha:1)

        context.setLineWidth(1/UIScreen.main.scale)

        context.strokePath()

        letstartPoint =CGPoint.init(x:17, y:0)

        letendPoint =CGPoint.init(x: rect.size.width-17, y:0)

        context.move(to: startPoint)

        context.addLine(to: startPoint)

        context.addLine(to: endPoint)

        context.strokePath()

    }

相关文章

网友评论

      本文标题:Swift 顶部分隔线

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