开发者

Resize UIWebView in detail view of split view controller

开发者 https://www.devze.com 2023-03-08 02:28 出处:网络
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 ensur开发者_运维

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 ensur开发者_运维百科e that the web view always occupies all available space in the detail view outside of the UIToolbar that lives at the top?


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;

0

精彩评论

暂无评论...
验证码 换一张
取 消