UIKeyboardWillHideNotification 系

2024-04-24  本文已影响0人  coding_Liu

在做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后,首次弹键盘不会触发隐藏键盘通知;

上一篇 下一篇

猜你喜欢

热点阅读