Ios UIWebView缩放与Safari不一样吗?
我正在开发一个小的UIWebView iOS应用程序,它指向我的网站,我已经正确设置了视口,在safari中或在主屏幕上添加书签时,它看起来很棒 但由于某些原因,当我将其插入UIWebView时,所有内容都变大了,我尝试在interface builder中取消选中UIWebView的“缩放以适合”,但这没有帮助 如何保持WebView在safari的相同方面进行缩放/显示 网站标题中的代码:Ios UIWebView缩放与Safari不一样吗?,ios,objective-c,uiwebview,Ios,Objective C,Uiwebview,我正在开发一个小的UIWebView iOS应用程序,它指向我的网站,我已经正确设置了视口,在safari中或在主屏幕上添加书签时,它看起来很棒 但由于某些原因,当我将其插入UIWebView时,所有内容都变大了,我尝试在interface builder中取消选中UIWebView的“缩放以适合”,但这没有帮助 如何保持WebView在safari的相同方面进行缩放/显示 网站标题中的代码: <!DOCTYPE html> <html lang="en"> <he
<!DOCTYPE html>
<html lang="en">
<head>
<script>
function goBack() {
window.history.back();
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<meta charset="UTF-8" />
<title>SITE TITLE</title>
<link rel="shortcut icon" href="{$url}/favicon.ico" />
<link href="{$url}/{$theme_path}/{$theme_name}/style.css" rel="stylesheet" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="HandheldFriendly" content="true" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link rel="apple-touch-icon-precomposed" href="WEBAPPICON.png"/>
</head>
我有同样的问题。有人吗?
//
// ViewController.m
// Webview
//
// Created by Stewart Crainie on 10/02/2014.
// Copyright (c) 2014 Stewart Crainie. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize receivedData, theConnection, webSite, back, forward, stop, refresh;
- (void)viewDidLoad
{
[self loadWebsite];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)loadWebsite {
NSString *fullURL = @"http://WEBVITEURL";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestWebsite = [NSURLRequest requestWithURL:url];
[webSite loadRequest:requestWebsite];
}
- (void)updateButtons
{
self.forward.enabled = self.webSite.canGoForward;
self.back.enabled = self.webSite.canGoBack;
self.stop.enabled = self.webSite.loading;
}
#pragma mark MBProgressHUDDelegate methods
- (void)hudWasHidden:(MBProgressHUD *)hud {
// Remove HUD from screen when the HUD was hidded
[HUD removeFromSuperview];
HUD = nil;
}
-(void)stopLoading {
NSLog(@"Stop Pushed");
[HUD hide:YES];
[webSite stopLoading];
}
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
NSLog(@"could not load the website caused by error: %@", error);
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Error"
message:[NSString stringWithFormat:@"%@", [error localizedDescription]]
delegate:self
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[message show];
[HUD hide:YES];
[webSite stopLoading];
}
-(void)webViewDidFinishLoad:(UIWebView *)webView {
[self updateButtons];
[HUD hide:YES];
[webSite stopLoading];
}
-(void)webViewDidStartLoad:(UIWebView *)webView {
[self updateButtons];
HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
HUD.delegate = self;
HUD.mode = MBProgressHUDModeIndeterminate;
HUD.labelText = @"Loading...";
}
@end