You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.1 KiB
54 lines
1.1 KiB
![]()
2 years ago
|
//
|
||
|
// XHMessageTextView.h
|
||
|
// MessageDisplayExample
|
||
|
//
|
||
|
// Created by HUAJIE-1 on 14-4-24.
|
||
|
// Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import <UIKit/UIKit.h>
|
||
|
|
||
|
typedef NS_ENUM(NSUInteger, XHInputViewType) {
|
||
|
XHInputViewTypeNormal = 0,
|
||
|
XHInputViewTypeText,
|
||
|
XHInputViewTypeEmotion,
|
||
|
XHInputViewTypeShareMenu,
|
||
|
};
|
||
|
|
||
|
@interface XHMessageTextView : UITextView
|
||
|
|
||
|
/**
|
||
|
* 提示用户输入的标语
|
||
|
*/
|
||
|
@property (nonatomic, copy) NSString *placeHolder;
|
||
|
|
||
|
/**
|
||
|
* 标语文本的颜色
|
||
|
*/
|
||
|
@property (nonatomic, strong) UIColor *placeHolderTextColor;
|
||
|
|
||
|
/**
|
||
|
* 获取自身文本占据有多少行
|
||
|
*
|
||
|
* @return 返回行数
|
||
|
*/
|
||
|
- (NSUInteger)numberOfLinesOfText;
|
||
|
|
||
|
/**
|
||
|
* 获取每行的高度
|
||
|
*
|
||
|
* @return 根据iPhone或者iPad来获取每行字体的高度
|
||
|
*/
|
||
|
+ (NSUInteger)maxCharactersPerLine;
|
||
|
|
||
|
/**
|
||
|
* 获取某个文本占据自身适应宽带的行数
|
||
|
*
|
||
|
* @param text 目标文本
|
||
|
*
|
||
|
* @return 返回占据行数
|
||
|
*/
|
||
|
+ (NSUInteger)numberOfLinesForMessage:(NSString *)text;
|
||
|
|
||
|
@end
|