ios - Hide keyboard when UIMenuViewController is shown -
when show uimenuviewcontroller
on uitextfiled
, keyboard pops up.
wondering if there way hide keyboard when uimenuviewcontroller
visible.
i use below code show menu.
nsarray *buttons = items; nsmutablearray *menuitems = [nsmutablearray array]; (nsstring *buttontext in buttons) { nsstring *sel = [nsstring stringwithformat:@"magic_%@", buttontext]; [menuitems addobject:[[uimenuitem alloc] initwithtitle:buttontext action:nsselectorfromstring(sel)]]; } uimenucontroller *menucont = [uimenucontroller sharedmenucontroller]; [menucont settargetrect:view.frame inview:view.superview]; menucont.arrowdirection = uimenucontrollerarrowdown; menucont.menuitems = menuitems; [menucont setmenuvisible:yes animated:yes];
when want hide keyboard (in example menu items visible) hiding keyboard use [textfield resignfirstresponder];
may problem solve
Comments
Post a Comment