我有一个iPad应用程序,应该显示移动谷歌UIWebView。它的宽度和iPhone一样是320px,我已经设置了用户代理,以便加载移动Google。但是该网站比UIWebView更宽,尽管该网站针对手机屏幕进行了优化。 这是我创建Web视图代码:iPad的UIWebView与iPhone网站
NSDictionary *userAgentDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:userAgentDictionary];
webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 44, 320, 480)];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]];
[webView loadRequest:request];
[self addSubview:webView];
这是怎么看起来像此刻:
我能做些什么,使之适合?它应该与其他非移动页面一起工作。
然后WebView被调整大小,但我希望webview像iPhone一样是320x480像素。但是,内容不适合在iPhone上使用。 – icant