描述一下需求:根据文本框输入文字判端不规范的时候在文本框下添加label展示错误提示,如下图:需求的样式, 所以在文本框代理方法-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string中进行动态修改布局,修改属性contentSizeInPopup;

一:首先弹出键盘时正常显示如下

问题:当开始键入内容,textview的代理方法里动态修改了contentSizeInPopup属性后,ViewController的view下移了。

当收起键盘后,ViewController的view下移的更多了

网友评论