Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

自定义textView,可以显示placeholder,可以修改placeholder字体颜色、大小.还可以设置textview的限制字数.

License

Notifications You must be signed in to change notification settings

zhoupIT/ZPTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

14 Commits

Repository files navigation

ZPTextView

自定义textView,可以显示placeholder,可以修改placeholder字体颜色、大小.还可以设置textview的限制字数. ###更新:### 添加isAdaptiveHeight属性,可以自适应高度.

##Adding to your project:## Drag and drop to your project 拖拽到你的项目.

##Basic usage:##

ZPTextView *textView = [[ZPTextView alloc] initWithFrame:CGRectMake(0, 50, self.view.frame.size.width, 80)];
textView.placeholder = @"开始新的一天咯(限制10个字符)";
textView.backgroundColor = [UIColor whiteColor];
/** 可以设置是否是自适应 */
textView.isAdaptiveHeight = Yes;
/** 限制字符的回调 */ 
[textView addMaxTextLengthWithMaxLength:10 andEvent:^(ZPTextView *text) {
 NSLog(@"限制了字符个数");
}];
/** 开始编辑的回调 */ 
[textView addTextViewBeginEvent:^(ZPTextView *text) {
 NSLog(@"开始编辑");
}];
/** 结束编辑的回调 */ 
[textView addTextViewEndEvent:^(ZPTextView *text) {
 NSLog(@"结束编辑");
}];
[self.view addSubview:textView];

示例图片

About

自定义textView,可以显示placeholder,可以修改placeholder字体颜色、大小.还可以设置textview的限制字数.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /