I’m trying to add a UIWebView inside a clean UIViewController which in my Storyboard is embedded in a Navigation Controller:
UIWebView *webView =[[UIWebView alloc] initWithFrame:self.view.bounds)];
webView.delegate = self;
[self.view addSubview:webView];
The problem is, that the self.view.bounds.size.height is 460, which seems to be the height of the entire view including the navigation bar. I could subtract the value of self.view.frame.origin.y which is 20 and get the desired hight of 440, but are there a more common way to do this?
EDIT
Please take a look at my small code example here: http://uploads.demaweb.dk/WebViewTest.zip
When you scroll down to the bottom of the UIWebView, the last part of the web site is not shown, as the webView is to high.
![enter image description here][1]
Solution
Setting the
autoresizingMaskin the UIWebView solved my problem:self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;