OC Control MarginLabel(間距Label)
阿新 • • 發佈:2021-02-18
技術標籤:UI的封裝iosobjective-cswiftxcode
一直覺得自己寫的不是技術,而是情懷,一個個的教程是自己這一路走來的痕跡。靠專業技能的成功是最具可複製性的,希望我的這條路能讓你們少走彎路,希望我能幫你們抹去知識的蒙塵,希望我能幫你們理清知識的脈絡,希望未來技術之巔上有你們也有我。
說明: 這個Label的所用是可以設定Label的左右上下間距的,系統自帶的Label設定背景的效果沒有上下左右間距的,後來自己自定義一個可以設定的。
效果
使用
@property (nonatomic,strong) FhxMarginLabel *label;
self .label = [[FhxMarginLabel alloc] initWithFrame:CGRectZero withPortrait:4 withHorizontal:4];
self.label.textColor = [UIColor whiteColor];
self.label.addTo(self.view).str(@"price").fnt(12).bgColor([Color theme]).borderRadius(4).makeCons(^{
make.center.equal.view(self.view);
} );