Created
April 22, 2010 07:26
-
-
Save mwbrooks/374922 to your computer and use it in GitHub Desktop.
PhoneGap-iPhone Viewport Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// A quick and dirty fix to issue #51 | |
// | |
- (void)applicationDidFinishLaunching:(UIApplication *)application | |
{ | |
CGRect windowFrame = [ [ UIScreen mainScreen ] bounds ]; | |
CGRect webViewFrame = [ [ UIScreen mainScreen ] applicationFrame ]; | |
webViewFrame.origin = windowFrame.origin; | |
self.window = [ [ [ UIWindow alloc ] initWithFrame:windowFrame ] autorelease ]; | |
self.window.autoresizesSubviews = YES; | |
viewController = [ [ PhoneGapViewController alloc ] init ]; | |
webView = [ [ UIWebView alloc ] initWithFrame:webViewFrame ]; | |
[webView setAutoresizingMask: (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight) ]; | |
[ viewController setWebView:webView ]; | |
[ viewController.view addSubview:webView ]; | |
// The remainder of the method can remain untouched... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment