JXTextView.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // JXTextView.h
  3. // MessageDisplayExample
  4. //
  5. // Created by qtone-1 on 14-4-24.
  6. // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSUInteger, XHInputViewType) {
  10. XHInputViewTypeNormal = 0,
  11. XHInputViewTypeText,
  12. XHInputViewTypeEmotion,
  13. XHInputViewTypeShareMenu,
  14. };
  15. @interface JXTextView : UITextView
  16. @property (nonatomic, assign) CGFloat previousTextViewContentHeight;
  17. @property (nonatomic, weak) id target;
  18. @property (nonatomic, assign) SEL didTouch;
  19. @property (nonatomic, assign) BOOL disableAutoSize;
  20. @property (nonatomic, assign) BOOL isEditing;
  21. /**
  22. * 提示用户输入的标语
  23. */
  24. @property (nonatomic, copy) NSString *placeHolder;
  25. /**
  26. * 标语文本的颜色
  27. */
  28. @property (nonatomic, strong) UIColor *placeHolderTextColor;
  29. /**
  30. * 获取自身文本占据有多少行
  31. *
  32. * @return 返回行数
  33. */
  34. - (NSUInteger)numberOfLinesOfText;
  35. /**
  36. * 获取每行的高度
  37. *
  38. * @return 根据iPhone或者iPad来获取每行字体的高度
  39. */
  40. + (NSUInteger)maxCharactersPerLine;
  41. /**
  42. * 获取某个文本占据自身适应宽带的行数
  43. *
  44. * @param text 目标文本
  45. *
  46. * @return 返回占据行数
  47. */
  48. + (NSUInteger)numberOfLinesForMessage:(NSString *)text;
  49. @end