自定义UILabel 继承 UILabel 重写drawTextInRect 方法具体如下:
CGRect rect = CGRectMake(rect.origin.x + 5, rect.origin.y + 5, rect.size.width - 10, rect.size.height -10);
[super drawTextInRect:rect];
表示上下左右距离边框的距离都是5;
自定义UILabel 继承 UILabel 重写drawTextInRect 方法具体如下:
CGRect rect = CGRectMake(rect.origin.x + 5, rect.origin.y + 5, rect.size.width - 10, rect.size.height -10);
[super drawTextInRect:rect];
表示上下左右距离边框的距离都是5;