I am trying to display some content in a web view that is smaller than the screen. This works in iOS 7, but in iOS 8, the web view seems to automatically set the size of the content of the web view to screen size. How can I convince UIWebViewusing view size for content size in iOS 8?
I created a minimal example that illustrates the problem. Starting with the one-time Xcode iPad template, I’ve added a web view that is 480 pixels high and 320 pixels wide, centered in the parent view. I connected this to the output webViewin an existing view controller. Then I added the code -viewDidLoadto upload the .mp4 video to the web view. Here is the full code:
@interface ViewController ()
@property IBOutlet UIWebView *webView;
@end
NSString *const videoURL = @"https://dl.dropboxusercontent.com/u/29161243/Mahalo%2520Surf%2520Eco%2520Festival%25202014%2520-%2520Day%25204-SD.mp4";
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSURL *url = [NSURL URLWithString:videoURL];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:request];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
@end
iOS 7 , . :

iOS 8, , ; , , -:

iOS 7 iOS 8? -?
iOS 7 UIWebView (, HTML-) , , -. , - , -, , .