Phonegap and iOS 7 Navigation Bar Issue

Having an issue with your navigation bar overlapping your application web view? Add this code in your viewWillAppear method

MainViewController.m

- (void)viewWillAppear:(BOOL)animated
{
    // View defaults to full size.  
    // If you want to customize the view's size, 
    // or its subviews (e.g. webView),
    // you can do so here.
    //Lower screen 20px on ios 7
    if ([[[UIDevicecurrentDevice] systemVersion] floatValue] >= 7) 
    {
        CGRect viewBounds = [self.webView bounds];
        viewBounds.origin.y = 18;
	viewBounds.size.height = viewBounds.size.height - 18;
	self.webView.frame = viewBounds;
    }

    [super viewWillAppear:animated];
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.