Skip to content

实现微信输入框效果(textView自适应文字高度)

Notifications You must be signed in to change notification settings

JlongTian/JLInputView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JLInputView

实现微信输入框效果(textView自适应文字高度),用法如下:

    // 设置文本框占位文字和字体颜色
    _inputView.placeholder = @"请输入内容";
    _inputView.placeholderColor = [UIColor lightGrayColor];
    
    //如果不需要占位文字就将placeholderHidden设置为YES
    //_inputView.placeholderHidden = YES;
    
    // 监听文本框文字高度改变
    _inputView.textHeightChangeBlock = ^(NSString *text,CGFloat textHeight){
    
        // 文本框文字高度改变会自动执行这个block,如果inputView的父视图需要随着它的高度改变而改变,那么就在这里修改高度
        
    };
    
    // 设置文本框最大行数
    _inputView.maxNumberOfLines = 4;

效果图:

效果图

About

实现微信输入框效果(textView自适应文字高度)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published