我正在开发一个 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];