口袋优选

UILabel+ChangeLineSpaceAndWordSpace.h 921B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // UILabel+ChangeLineSpaceAndWordSpace.h
  3. // Elephant
  4. //
  5. // Created by dyy on 2018/1/19.
  6. // Copyright © 2018年 杭州大象品牌营销策划有限公司. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @interface UILabel (ChangeLineSpaceAndWordSpace)
  10. - (void)changeLineSpaceWithSpace:(float)space;
  11. /**
  12. * 字间距
  13. */
  14. @property (nonatomic,assign)CGFloat characterSpace;
  15. /**
  16. * 行间距
  17. */
  18. @property (nonatomic,assign)CGFloat lineSpace;
  19. /**
  20. * 关键字
  21. */
  22. @property (nonatomic,copy)NSString *keywords;
  23. @property (nonatomic,strong)UIFont *keywordsFont;
  24. @property (nonatomic,strong)UIColor *keywordsColor;
  25. /**
  26. * 下划线
  27. */
  28. @property (nonatomic,copy)NSString *underlineStr;
  29. @property (nonatomic,strong)UIColor *underlineColor;
  30. /**
  31. * 计算label宽高,必须调用
  32. *
  33. * @param maxWidth 最大宽度
  34. *
  35. * @return label的rect
  36. */
  37. - (CGSize)getLableRectWithMaxWidth:(CGFloat)maxWidth;
  38. @end