ios - Why is UIKeyboardWillShowNotification called every time another TextField is selected? -


i have project contains uiscrollview , many uitextfield inside it.

for first time select uitextfield, uikeyboardwillshownotification called, fine. whenever select new uitextfield (the keyboard still there), uikeyboardwillshownotification called again !!!, weird.

i set symbolic breakpoint [uiresponder resignfirstresponder] , see hit before , after uikeyboardwillshownotification called !!!

the other thing uikeyboardwillhidenotification called when hit "done" button on keyboard

i'm sure not call resignfirstresponder, becomefirstresponder, endediting anywhere. (i mean not call wrongly)

what can cause problem ?

here stacktrace enter image description here

the problem set inputaccessoryview uitextfield, , cause uikeyboardwillshownotification being called again when new uitextfield selected

this article working keyboard on ios explains well

additional changes take place when connect external keyboard ipad. in particular case, notification behavior depends on inputaccessoryview property of control reason displaying keyboard.

if inputaccessoryview not present or height equal 0 points, no keyboard notifications sent. guess because in case, no visual changes take place in application. otherwise, notifications behave expected – means being sent in majority of cases when keyboard displayed or hidden in normal (not undocked or split) state.

whenever new uitextfield selected, os needs compute frame keyboard again, , following notifications posted

uikeyboardwillchangeframenotification uikeyboardwillshownotification uikeyboarddidchangeframenotification uikeyboarddidshownotification 

the same applies when textfield loses first responder status

note using same view inputaccessoryview cause uikeyboardwillshownotification called once


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -