12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // MTBaseLabel.m
- //
- // Created by Simon on 2019/3/22.
- // Copyright © 2019 Simon. All rights reserved.
- //
- #import "MTBaseLabel.h"
- @implementation MTBaseLabel
- //UILable方法实现
- +(MTBaseLabel *)labelWithFrame:(CGRect)rect backGroundColor:(UIColor *)color1 text:(NSString *)text textColor:(UIColor *)color2 font:(UIFont *)floatFont
- {
- MTBaseLabel *lb = [[MTBaseLabel alloc]init];
- lb.frame = rect;
- lb.backgroundColor = color1;
- lb.text = text;
- lb.textColor = color2;
- lb.font = floatFont;
- return lb;
-
- }
- +(MTBaseLabel *)labelWithTextColor:(UIColor *)color font:(UIFont *)floatFont{
- MTBaseLabel *lb = [[MTBaseLabel alloc]init];
- lb.textColor = color;
- lb.font = floatFont;
- return lb;
- }
- +(MTBaseLabel *)labelWithText:(NSString *)text andColor:(UIColor *)color font:(UIFont *)floatFont{
- MTBaseLabel *lb = [[MTBaseLabel alloc]init];
- lb.textColor = color;
- lb.font = floatFont;
- lb.text = text;
- return lb;
- }
- - (instancetype)init
- {
- self = [super init];
- if (self) {
- self.adjustsFontSizeToFitWidth = YES;
- }
- return self;
- }
- /*
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect {
- // Drawing code
- }
- */
- @end
|