XYRichText.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // XYRichText.h
  3. // Timi
  4. //
  5. // Created by gy on 2021/1/30.
  6. //
  7. #ifndef CGFLOAT_CEIL
  8. #ifdef CGFLOAT_IS_DOUBLE
  9. #define CGFLOAT_CEIL(value) ceil(value)
  10. #else
  11. #define CGFLOAT_CEIL(value) ceilf(value)
  12. #endif
  13. #endif
  14. #import <Foundation/Foundation.h>
  15. #import "AWRichText.h"
  16. NS_ASSUME_NONNULL_BEGIN
  17. @interface XYRichText : AWRichText
  18. /** 文字 */
  19. + (AWRTTextComponent *)getTextComponent:(NSString *)content color:(UIColor *)color font:(UIFont *)font padding:(NSInteger )padding;
  20. /** 设置本地图片 */
  21. + (AWRTImageComponent *)getImageComponent:(UIImage *)image font:(UIFont *)font padding:(NSInteger )padding;
  22. /** view需设置frame */
  23. + (AWRTViewComponent *)getViewComponent:(UIView *)view font:(UIFont *)font padding:(NSInteger )padding;
  24. /**获取AWRichText的富文本 */
  25. + (NSAttributedString *)getAbString:(AWRichText *)richTex andView:(UIView *)view;
  26. /** 获取AWRichText的富文本的size
  27. CGSizeMake(TTextMessageCell_Text_Width_Max, MAXFLOAT) 获取高
  28. */
  29. + (CGSize )getAbSize:(NSAttributedString *)AbString andRectSize:(CGSize )rectSize;
  30. /** 获取AWRichText的富文本的size
  31. CGSizeMake(KLiveRoomChatListCellWidth - 40, 0)].height; 获取高
  32. */
  33. + (CGSize )getRtSize:(AWRichText *)richText andRectSize:(CGSize )rectSize;
  34. @end
  35. NS_ASSUME_NONNULL_END