【发布时间】:2010-07-07 12:52:11
【问题描述】:
我在 iPad 上使用 UIWebView,我通过下面的代码对其进行初始化。问题是视图永远不会显示在状态栏下方的页面顶部,但是还有另一个 44px 空间(用黑色填充) - 用于导航栏,我不想显示。有什么提示可以让 UIWebView 在没有 44px 空间的情况下显示?
非常感谢,
BR
斯特恩
- (void)viewDidLoad
{
[super viewDidLoad];
CGRect rectApp = [[UIScreen mainScreen] applicationFrame];
self.webView = [[[UIWebView alloc] initWithFrame:rectApp] autorelease];
self.webView.backgroundColor = [UIColor whiteColor];
self.webView.scalesPageToFit = YES;
self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.webView.delegate = self;
[self.view addSubview: self.webView];
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.test.com/shop/index.php"]]];
}
【问题讨论】:
标签: cocoa-touch ipad uiwebview