Created
September 11, 2012 05:08
-
-
Save lbj96347/3696091 to your computer and use it in GitHub Desktop.
Phonegap Keyboard Auto Hide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This file concludes native code and javascript code and u just need to paste native code into your phonegap plugin */ | |
| /* native code part */ | |
| /* keyboard auto hide solution */ | |
| - (void) hideKeyboard:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options | |
| { | |
| //UIButton *button = [UIButton | |
| buttonWithType:UIButtonTypeRoundedRect; | |
| NSLog(@"hideKeyboard is being called"); | |
| [self.webView endEditing:YES]; | |
| } | |
| /* javascript part */ | |
| function hideKeyboard(){ | |
| console.log("关闭键盘"); | |
| cordova.exec("ChildBrowserCommand.hideKeyboard", "隐藏键盘"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment