how to dismiss already opened keyboard when popover appears ios -
in ios project, have form contains various text fields. text fields edited keyboard , picker view placed on popover.
when go on filling text fields, without dismissing , if click on popover text field keyboard remains open.
it appears both keyboard , popover present on screen @ same time, don't want.
i able whether keyboard opened or not setting flag in keyboard notification methods , last text filed edited through text filed delegates. , have tried
[self endediting:yes]; (as in table cell)
[lasteditedtextfield resignfirstresponder];
even try pass keyboard dismiss notification self (without knowing whether possible or not)
- [[nsnotificationcenter defaultcenter] postnotificationname:uikeyboardwillhidenotification object:nil];
but nothing working.
how can dismiss keyboard (if open) whenever popover appears.
thanks in advance.
try implement textfieldshouldbeginediting:
, inside check text field this. if 1 of fields should display popover, first call [self.view endediting:yes]
hide keyboard, present popover , return no
. way text field won't take first responder status , keyboard not appear again. , if 1 of "normal" text fields, return yes
.
Comments
Post a Comment