文档

段落输入框

AUParagraphInputBox 为段落输入框控件,支持在业务中设置最大字数限制。

效果图

接口说明

// 段落输入框

@interface AUParagraphInputBox : UIView

@property (nonatomic, strong) UITextView *textView;      // 输入框
@property (nonatomic, assign) NSInteger maxInputLen;     // 设置最大输入字数(需要才设置)

// 初始化
- (instancetype)initWithFrame:(CGRect)frame placeHolder:(NSString *)placeHolder;

// 设置 placeHolder 文本
- (void)setPlaceHolder:(NSString *)placeHolder;

@end

代码示例

_paragraphInputBox = [[AUParagraphInputBox alloc] init];
_paragraphInputBox.frame = CGRectMake(0, startY, AUCommonUIGetScreenWidth(), 10);
_paragraphInputBox.maxInputLen = 1240;
_paragraphInputBox.textView.delegate = self;
[_paragraphInputBox setPlaceHolder:@"请输入你想表达的内容"];
[self.view addSubview:_paragraphInputBox];
  • 本页导读 (0)
文档反馈