UIWebView not scaling to fit
This problem has been hounding me for days... I have a URL for a web camera (which just pushes jpegs) at a 640x480 aspect. When I make a webVie开发者_如何学JAVAw on an iPad at 640x480 everything is OK. However, if I have a 320x240 webView for the iPhone or iPad here are the results:
320x240 webView -> shows the upper left 320x240 as expected. 320x240 WebView with ScalePageToFit turned on -> the image returned is a tiny 640x480 view plus a whole lot of space to the right and bottom.
I think I have tried all of the suggestions here. Can anyone give me a suggestion to get a 320x240 from 640x480? Here is the cameras URL: http://75.25.157.90/nphMotionJpeg?Resolution=640x480&Quality=Standard
Also changing the URL to say Resolution-320x240 does nothing...
Thanks
You can try adding this meta tag to the HTML for 320px width resolution:
<meta name="viewport" content="width=320; user-scalable=false" />
If you can't add this to the remote URL, you can use a local template, where you can replace the remote content:
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=false" />
</head>
<body>
{TAG_TO_REPLACE}
</body>
</html>
精彩评论