1、由于label控件没有contentInsets属性,需要自定义label,添加Insets 属性,并重写父类的几个方法
//下面四个方法用来初始化edgeInsets
- (instancetype)init {
if (self = [super init]) {
self.edgeInsets = UIEdgeInsetsMake(10, 0, 10, 0);
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
if(self = [super initWithFrame:frame])
{