Created
February 26, 2012 17:27
-
-
Save jglozano/1917862 to your computer and use it in GitHub Desktop.
Correct way of making a UIWebView that takes full screen and handles the notification/resizing correctly
This file contains hidden or 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
| private UIWebView CreateWebView(NSUrlRequest urlRequest) { | |
| var webView = new UIWebView(this.View.Bounds); | |
| webView.AutosizesSubviews = true; | |
| webView.AutoresizingMask = (UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth); | |
| webView.LoadRequest(urlRequest); | |
| webView.LoadError += (sender, e) => { | |
| var view = sender as UIWebView; | |
| view.LoadHtmlString("<html><body><h1>Oops!</h1></body></html>",null); | |
| }; | |
| return webView; | |
| } |
Author
sweet, that's what I was hoping! The app is going to be all mobile UI, I just need the native app to setup push notifications and other pieces.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That will occupy 100% of the parent view's frame, yes.