override func drawText(in rect: CGRect) {
// 1.获取上下文
let context = UIGraphicsGetCurrentContext()
// 2.给上下文线段设置一个宽度, 通过该宽度画出文本
context?.setLineWidth(5)
context?.setLineJoin(.round)
context?.setTextDrawingMode(.stroke)
textColor = UIColor.orange
super.drawText(in: rect)
context?.setTextDrawingMode(.fill)
textColor = UIColor.white
super.drawText(in: rect)
}
01-04
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交