猎豆优选

UILabel+ChangeLineSpaceAndWordSpace.h 874B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. /**
  11. * 字间距
  12. */
  13. @property (nonatomic,assign)CGFloat characterSpace;
  14. /**
  15. * 行间距
  16. */
  17. @property (nonatomic,assign)CGFloat lineSpace;
  18. /**
  19. * 关键字
  20. */
  21. @property (nonatomic,copy)NSString *keywords;
  22. @property (nonatomic,strong)UIFont *keywordsFont;
  23. @property (nonatomic,strong)UIColor *keywordsColor;
  24. /**
  25. * 下划线
  26. */
  27. @property (nonatomic,copy)NSString *underlineStr;
  28. @property (nonatomic,strong)UIColor *underlineColor;
  29. /**
  30. * 计算label宽高,必须调用
  31. *
  32. * @param maxWidth 最大宽度
  33. *
  34. * @return label的rect
  35. */
  36. - (CGSize)getLableRectWithMaxWidth:(CGFloat)maxWidth;
  37. @end