Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have come across the need to do this myself. I am an IOS developer, but needed to use phonegap to keep costs down for multiplatform dev. </p> <p>Anyway, i fixed your code. As, i guess, you dont want to spend your time learning obj-c, you just need to replace the contents of your MainViewController.m with the following:</p> <pre><code>#import "MainViewController.h" @implementation MainViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; } return self; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; } - (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]; } } } } } - (void)keyboardWillShow:(NSNotification*) notification { // remove the bar in the next runloop (not actually created at this point) [self performSelector:@selector(removeBar) withObject:nil afterDelay:0]; } @end </code></pre> <p>As a word of warning, this is a bit of a hacky solution (but then so is using phonegap!), and may break in future versions of iOS. But i guess we fix that when it comes to it...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload