I have a UIWebView in the detail view of my split view controller application. Everything works fine, but the width of the web view does not change when the iPad is rotated. How can I ensure that the web view always occupies all available space in the detail view outside of the UIToolbar that lives at the top?
Share
set the uiwebview frame property to match that of the parent view, adding some padding as needed.
WebView = [[UIWebView alloc] initWithFrame:CGRectMake(5, 5, self.view.frame.size.width -5, self.view.frame.size.height -5)];
use the “autoresize” and set flexible width and/or height. that should do the trick
WebView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;