2012-08-27 64 views
1

我向WebView添加了几张图像,图像旋转了90度与预期相符。
这是因为三星相机用.jpg照片+ EXIF旋转标签拍摄。
相同图像在画廊中显示正常,但不在我的WebView中。将本地图像添加到WebView并不重视EXIF旋转

String htmlWithImages = "<html> <some html>"; 
htmlWithImages += imageUri; // Image's content uri like content:// 
mWebView.loadDataWithBaseURL("", htmlWithImages, "text/html", "utf-8", ""); 

这是一个缺陷WebView?任何解决方法?

回答

2

也许你可以使用CSS3将图像旋转的WebView内:http://bavotasan.com/2011/rotated-images-with-css3/http://www.kavoir.com/2009/08/css-rotate-text-image-elements-by-90-180-or-270-degrees.html

-webkit-transform: rotate(-90deg); 
-moz-transform: rotate(-90deg); 
+0

这是一个很好的解决方法和它的作品OS 3.0+。通用的解决方法将有所帮助。 – Taranfx

+0

CSS3旋转有一个大问题。当它旋转时,它会占用图像的旧宽度和高度。我已经使用CSS来拉伸图像以获得宽度的95%,现在,当它旋转时,尺寸是旧的。 – Taranfx

+0

重叠图片的截图:http://imgur.com/qS3KH – Taranfx

相关问题