UIKeyboardWillHideNotification 系统函数在第一次进入时调用

在做textview文本输入时,刚进入发现根据键盘改textview大小无效,后来发现是在监听


    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillShow:)
                                                 name:UIKeyboardWillShowNotification
                                               object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillHide:)
                                                 name:UIKeyboardWillHideNotification
                                               object:nil];

函数是 第一次弹起键盘UIKeyboardWillHideNotification也被调用造成的。
原因是IQKeyboardManager 的toolBar导致的 , [IQKeyboardManager sharedManager].enable = NO; 关闭这个关闭不了toolBar;关闭了toolBar后,首次弹键盘不会触发隐藏键盘通知;

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容