ios - KeyBoard gets locked after popover dismissal -


there multiple textfields in viewcontroller in of them customised (one tapping textfield launch popover controller, user can select option displayed in tapped textfield).

i have tap gesture on view controller dismissing keyboard (if it's on screen).

keypad gets locked(if it's visible) when open popover controller on taping customised textfield. keyboard not getting dismissed if tap on parent view or else on dismiss button in keypad.

i have tried 2 snippets hide keyboard, it's not working

[self.scrollview endediting:yes]; [[[uiapplication sharedapplication] keywindow] endediting:yes]; 

you can use textfields delegate prevent presenting keyboard , instead present popover implementing textfieldshouldbeginediting method

- (bool)textfieldshouldbeginediting:(uitextfield *)textfield {     if(textfield == mycustomtextfield) {         [self opencustompopover];         return no;     }     return yes; } 

more on delegate methods here https://developer.apple.com/library/ios/documentation/uikit/reference/uitextfielddelegate_protocol/index.html#//apple_ref/occ/intfm/uitextfielddelegate/textfieldshouldbeginediting:


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -