UIWebview: does not rotate or change to fit the entire screen

The verification code is available here for your comments.

1) The task of rotation:

I implemented

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } 

in the WebViewController.m file, but it still doesn't rotate. (See the pictures below)

Portrait

Landscape

2) size problem

As you can see in the pictures, the bottom of the screen is blank (about 25% of the screen). I checked the xib file and the UIWebView seems to be configured correctly.

Did I make some very obvious mistake?

+4
source share
1 answer

You do not save the view controller for the web view in the applicationโ€™s deletion.

To fix the replacement,

 [self.window addSubview:wvc.view] -> [[self window] setRootViewController:wvc]; 
+5
source

Source: https://habr.com/ru/post/1345452/


All Articles