// // MyUILabel.m // tongxin // // Created by ecell on 2021/6/9. // Copyright © 2021 xTT. All rights reserved. // #import "MyUILabel.h" @implementation MyUILabel /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code } */ - (void)drawTextInRect:(CGRect)rect { // 边距,上左下右 UIEdgeInsets insets = {10, 10, 10, 10}; [super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)]; } @end