I don't know any Objective-C, that is why I'm using PhoneGap to create an iOS app. There is a big flaw in PhoneGap for iOS. The keyboard constantly has the form assistant (the 'next', 'previous' and 'done' buttons.) There is very little information on the web on how to get rid of this, all of the Stackoverflow questions about it said it was practically impossible. But after a while I stumbled upon this tutorial. The bottom paragraph tells you how to do it. And it works, I downloaded and tested the finished app.
But since I have no idea how to do almost anything in Xcode, or in Objective-C, I have no idea what files the two sections of code go into, he doesn't say in the tutorial.
Can anyone tell me where in the PhoneGap apps files it goes? I'd appreciate it massively, this has been bugging me all day.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
And this
RichTextEditorViewController *viewController = [[RichTextEditorViewController alloc] initWithNibName:@"RichTextEditorViewController" bundle:nil];
self.viewController = [[UINavigationController alloc] initWithRootViewController:viewController];
Also this
- (void)removeBar {
// Locate non-UIWindow.
UIWindow *keyboardWindow = nil;
for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) {
if (![[testWindow class] isEqual:[UIWindow class]]) {
keyboardWindow = testWindow;
break;
}
}
// Locate UIWebFormView.
for (UIView *possibleFormView in [keyboardWindow subviews]) {
// iOS 5 sticks the UIWebFormView inside a UIPeripheralHostView.
if ([[possibleFormView description] rangeOfString:@"UIPeripheralHostView"].location != NSNotFound) {
for (UIView *subviewWhichIsPossibleFormView in [possibleFormView subviews]) {
if ([[subviewWhichIsPossibleFormView description] rangeOfString:@"UIWebFormAccessory"].location != NSNotFound) {
[subviewWhichIsPossibleFormView removeFromSuperview];
}
}
}
}
}
Thank you!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…