問題
在一些全局彈框中由于遮罩層加在keywindow上,自定義view加在了遮罩層上,導(dǎo)致IQKeyboardManager對(duì)textField的自適應(yīng)失效知允。
[[UIApplication sharedApplication].keyWindow addSubview:_shadeView];
解決
再參考眾多資料后柑营,找到解決辦法。把直接添加到keyWindow改為keyWindow.rootViewController.view
親測(cè)有效!
[[UIApplication sharedApplication].keyWindow.rootViewController.view addSubview:_shadeView];