I tried adding AdMob to the Cordova project, so I resized the webview when the application loaded.
- (void)viewWillAppear:(BOOL)animated {
Now the webview size should be 320X410. But, more about a 10px empty block at the bottom of the page when it loads. The same problems also appear in landscape representation.
Screenshots are being taken. 
This only occurs when the website is resized, and the content exceeds the screen. These problems will appear in the simulator iphone 5.0 5.1 6.0, and not in the 4-inch portrait representation of Retina, and not in the simulator ipad.
This is the html code:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Single page template</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.min.css" /> <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.0-beta.1/jquery.mobile-1.3.0-beta.1.min.js"></script> </head> <script type="text/javascript"> $(document).ready(function() { alert($(window).height()); alert($(document).height()); alert($("body").height()); }); </script> <body> <div data-role="page"> <div data-role="header"> <h1>Single page</h1> </div> <div data-role="content"> <p>This is a single page boilerplate template that you can copy to build your first jQuery Mobile page. Each link or form from here will pull a new page in via Ajax to support the animated page transitions.</p> </div> </div> </body> </html>
config.xml
<preference name="KeyboardDisplayRequiresUserAction" value="true" /> <preference name="SuppressesIncrementalRendering" value="false" /> <preference name="UIWebViewBounce" value="false" /> <preference name="TopActivityIndicator" value="gray" /> <preference name="EnableLocation" value="false" /> <preference name="EnableViewportScale" value="false" /> <preference name="AutoHideSplashScreen" value="true" /> <preference name="ShowSplashScreenSpinner" value="false" /> <preference name="MediaPlaybackRequiresUserAction" value="false" /> <preference name="AllowInlineMediaPlayback" value="false" /> <preference name="OpenAllWhitelistURLsInWebView" value="false" /> <preference name="BackupWebStorage" value="cloud" />
app inits
self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease]; self.window.autoresizesSubviews = YES; self.viewController = [[[MainViewController alloc] init] autorelease]; self.viewController.useSplashScreen = NO; self.viewController.wwwFolderName = @"www"; self.viewController.startPage = @"index.html";
Cordoba 2.3.0 Xcode 4.5.2 jQuery Mobile 1.3.0 beta1, 1.2.0
How do I fix this problem? Thanks!
source share