私は、ページの半分がwebviewになり、残りの半分が他のもので埋められるようにするアプリケーションを作成しています。問題は、UIビルダでビューをレイアウトすると正しい幅と高さですが、実際にロードすると画面全体が塗りつぶされるということです。あなたがこのコードのほとんどを必要としないiOSのUIWebView
- (void)loadView
{
// Create a custom view hierarchy.
CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
UIView *view = [[UIView alloc] initWithFrame:appFrame];
self.view = view;
[view release];
CGRect webFrame = [[UIScreen mainScreen] applicationFrame];
webView = [[UIWebView alloc] initWithFrame:webFrame];
webView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:webView];
NSString *html = @"<html><head><title>Should be half</title></head><body>I wish the answer were just 42</body></html>";
[webView loadHTMLString:html baseURL:nil];
}