I have a problem with UIWebView. When a view loads it, loads in any direction, perfectly fills the entire page, etc.
However, tell me if I download it in the portrait, and then rotate the device, the web view does not fill out completely to the right side, and I can’t understand why.
This is my view on the boot method.
- (void)viewDidLoad
{
[super viewDidLoad];
if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortrait){
self.measurementsWebView.frame = CGRectMake(0, 0, 320, 367);
}else if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeLeft || [[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeRight){
self.measurementsWebView.frame = CGRectMake(0, 0, 480, 218);
}
NSString *path = [[NSBundle mainBundle] pathForResource:@"measurements" ofType:@"png"];
[measurementsWebView loadHTMLString:[NSString stringWithFormat:@"<html><body><img src=\"file://%@\"></body></html>",path] baseURL:nil];
measurementsWebView.scalesPageToFit = YES;
}
If I look in the interface constructor, I try to find a panel that allows me to set the expanding width or what you ever call it, but all I see is that.

any help would be greatly appreciated
source
share