原文:https://blog.csdn.net/dolacmeng/article/details/81204469
需求如图,UILabel要实现带红色边的文字显示。
1、新建UILabel的子类JXBorderLabel
2、重写drawRect:方法
#import "JXBorderLabel.h"
@implementation JXBorderLabel
- (void)drawRect:(CGRect)rect {
//1.获取上下文
CGContextRef context = UIGraphicsGetCurrentContext();
//2.给上下文线段设置线宽,...