-2

Here is an image of my problem in an app: enter image description here enter image description here

Here is my code: http://pastebin.com/JckpYKYz

Any solution?

I thought to hide the status bar when the keyboard appears on that page.

Thanks!

Manuel Egío
  • 173
  • 1
  • 9
  • No code? No mention of what this is(app, website, etc.)? No mention of what you used to create this? – APAD1 May 20 '14 at 15:54

2 Answers2

0

In cordova by default the status bar is shown. you can hide the status programatically by adding some code in your cordova project. Your situation can be managed easily by changing some native codes.

Open your project,

collapse "CordovaLib.xcodeproj" >> Classes >> Cleaver >> CDVViewController.m

In that file you cvan find a function called

- (void)viewDidLoad

in that enter the below code line

[[UIApplication sharedApplication] setStatusBarHidden:YES];

Mine look like this,

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSURL* appURL = nil;
    NSString* loadErr = nil;
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
    [[webView scrollView] setBounces: NO];
    if ([self.startPage rangeOfString:@"://"].location != NSNotFound) {
        appURL = [NSURL URLWithString:self.startPage];
.......

[OR]

If you wan to show status bar all time and just want to hide it when the keyboard come up,

then check for another function in the same file called,

- (void) keyboardWillShow:(NSNotification *)note {

and enter the below code line,

[[UIApplication sharedApplication] setStatusBarHidden:YES];

and in,

- (void) keyboardWillHide:(NSNotification *)note {

enter the below code line,

[[UIApplication sharedApplication] setStatusBarHidden:NO];

In some cordova version there will be only this,

- (void)keyboardWillShowOrHide:(NSNotification*)notif

in that situation write a condition to check if keyboard is shown or hidden and put the above code line in them to show and hide status bar.

Hope this is what you are looking for, please accept the answer if you are satisfied. Good day!

locknies
  • 1,345
  • 3
  • 15
  • 36
  • Thanks! I used two cordova plugins (keyboard and statusbar), so that when the keyboard appears, the status bar is hidden. But I would prefer that the navigation bar could be fixed somehow... – Manuel Egío May 21 '14 at 06:59
  • navigation bar problem ? whats that? Please post a normal screen shot and another one when the keyboard shows. An also elaborate your question! – locknies May 21 '14 at 07:22
  • I've updated the post with the new image. When the keyboard appears pushes the navigation bar up instead of staying fixed on top. I do not know how to make the scroll does not affect navigation bar. – Manuel Egío May 21 '14 at 08:28
  • Go to this function as i mentioned above " - (void)keyboardWillShow:(NSNotification *)note { " and comment everything inside that function, and recheck it. – locknies May 21 '14 at 09:32
  • There is no this function in the file CDVViewController.m – Manuel Egío May 22 '14 at 08:59
0

I think that it is css problem. Probably height of the HTML compoentn is specified with "%". Specify height with "px" or use position: absolute.

Displaying the software keyboard affects the height of html element.

ataru
  • 401
  • 3
  • 6