2012-08-27 63 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

相關問題