UILabel+MyLabel.m 1021 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // UILabel+MyLabel.m
  3. // PopupWindow
  4. //
  5. // Created by 杨仁伟 on 2017/5/16.
  6. // Copyright © 2017年 yrw. All rights reserved.
  7. //
  8. #import "UILabel+MyLabel.h"
  9. @implementation UILabel (MyLabel)
  10. + (UILabel *)quickLabelWithFrame: (CGRect)frame color: (UIColor *)color font: (NSInteger)font text: (NSString *)text superView: (UIView *)superView
  11. {
  12. UILabel *label = [[UILabel alloc]initWithFrame:frame];
  13. label.textColor = color;
  14. label.font = [UIFont systemFontOfSize:font];
  15. label.text = text;
  16. [superView addSubview:label];
  17. return label;
  18. }
  19. + (UILabel *)quickCreatePopupWindowRoomListLabelWithFrame:(CGRect)frame text:(NSString *)text supView:(UIView *)supView
  20. {
  21. UILabel *label = [[UILabel alloc]initWithFrame:frame];
  22. label.textColor = [UIColor darkGrayColor];
  23. label.backgroundColor = [UIColor whiteColor];
  24. label.font = [UIFont systemFontOfSize:14];
  25. label.text = text;
  26. label.textAlignment = NSTextAlignmentCenter;
  27. [supView addSubview:label];
  28. return label;
  29. }
  30. @end