UIWebView未涵盖横向模式下的整个视图

Goo*_*tan 3 landscape uiwebview ipad ios

我正在开发一个iPad应用程序,当用户通过登录表单进行身份验证时,它将以模态方式加载UIWebView中的网页.这很好用,但是当我将设备旋转到横向模式时,webview只覆盖屏幕的75%:

屏幕截图显示了问题

这是我的登录视图控制器的代码:

    // Load storyboard for easy instatiation of the login view controller
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil];
    WebViewController *webController =
    (WebViewController *)[storyboard instantiateViewControllerWithIdentifier:@"WebView"];

    // Present the embedded browser in fullscreen.
    [webController setModalPresentationStyle:UIModalPresentationFullScreen];
    [self presentViewController:webController animated:YES completion: nil];
Run Code Online (Sandbox Code Playgroud)

los*_*sit 5

您使用约束或自动调整大小的面具吗?如果没有,您可能想要使用它们并确保Web视图覆盖整个视图的框架.