监测 UITextField 输入
- textField 添加target 触发条件 UIControlEventEditingChanged ,响应 textField 编辑时的内容改变事件
[self.textFeild addTarget:self action:@selector(passConTextChange:) forControlEvents:UIControlEventEditingChanged];
- (void)textFieldEditingChanged:(UITextField *)textField{
NSUInteger textLength = textField.text.length;
if (!textLength) {
textField.font = [UIFont systemFontOfSize:12.0f];
}else {
textField.font = [UIFont systemFontOfSize:20.0f];
}
}
本文标题:监测 UITextField 输入
本文链接:https://www.haomeiwen.com/subject/pjkzyxtx.html
网友评论