-
Notifications
You must be signed in to change notification settings - Fork 30
Home
Welcome to the TextViewPlaceholder wiki!
![效果图](http://7xj1v1.com1.z0.glb.clouddn.com/textView.gif)
1: 基本功能
@property(copy,nonatomic) NSString *placeholder;
-(void)setPlaceholderColor:(UIColor*)color;
设置Placeholder 字体-(void)setPlaceholderFont:(UIFont*)font;
设置透明度-(void)setPlaceholderOpacity:(float)opacity;
2: 附加功能
增加text 长度限制
-(void)addMaxTextLengthWithMaxLength:(NSInteger)maxLength andEvent:(void(^)(BRPlaceholderTextView*text))limit;
开始编辑 的 回调
-(void)addTextViewBeginEvent:(void(^)(BRPlaceholderTextView*text))begin;
-(void)addTextViewEndEvent:(void(^)(BRPlaceholderTextView*text))End;
用例:
BRPlaceholderTextView view=[[BRPlaceholderTextView alloc] initWithFrame:CGRectMake(10, 100, 320 -102, 80)];
view.placeholder=@"请输入xxxx阿达索朗多吉阿克琉斯的距离卡洛斯大家阿莱克斯多久阿萨德卡拉斯京的卡拉胶上地理课:1231123";
view.font=[UIFont boldSystemFontOfSize:14];
view.layer.borderColor=[UIColor lightGrayColor].CGColor;
[self.view addSubview:view];