JCHATMessageTextView.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // JCHATMessageTextView.h
  3. // JPush IM
  4. //
  5. // Created by Apple on 15/1/14.
  6. // Copyright (c) 2015年 Apple. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSUInteger, JPIMInputViewType) {
  10. JPIMInputViewTypeNormal = 0,
  11. JPIMInputViewTypeText,
  12. JPIMInputViewTypeEmotion,
  13. JPIMInputViewTypeShareMenu,
  14. };
  15. @interface JCHATMessageTextView : UITextView
  16. @property (nonatomic, weak) UIResponder *overrideNextResponder;
  17. /**
  18. * 提示用户输入的标语
  19. */
  20. @property (nonatomic, copy) NSString *placeHolder;
  21. /**
  22. * 标语文本的颜色
  23. */
  24. @property (nonatomic, strong) UIColor *placeHolderTextColor;
  25. /**
  26. * 获取自身文本占据有多少行
  27. *
  28. * @return 返回行数
  29. */
  30. - (NSUInteger)numberOfLinesOfText;
  31. /**
  32. * 获取每行的高度
  33. *
  34. * @return 根据iPhone或者iPad来获取每行字体的高度
  35. */
  36. + (NSUInteger)maxCharactersPerLine;
  37. /**
  38. * 获取某个文本占据自身适应宽带的行数
  39. *
  40. * @param text 目标文本
  41. *
  42. * @return 返回占据行数
  43. */
  44. + (NSUInteger)numberOfLinesForMessage:(NSString *)text;
  45. @end