2010-11-10 84 views
2

Hai Freinds, 我已經解析了url中的圖像,並顯示在webview中,當我在webview中顯示它時,幾個圖像被拉伸,所以我在Imageview的幫助下顯示圖像,但問題是當Image顏色格式爲CMYK格式時,圖像不會在Imageview中顯示,因此請告訴我如何在webview中顯示圖像而不會顯示圖像,或者如何在ImageView中顯示圖像的所有格式。需要幫助才能在Android中的WebView中正確顯示圖像?

我的XML代碼

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/LinearLayout02_img" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="horizontal">    
     <WebView android:id="@+id/ads_content" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
</WebView> 
</LinearLayout> 

和我的Java代碼是

私人的WebView ads_content; (網絡視圖) ads_content.loadUrl(url);

參考這說明我的輸出 alt text

我必須表現出高達設備級圖像的截圖中,泰國是要阻止白色和黑色的空白空間 感謝

+0

張貼一些截圖,也許我們可以幫助。 – 2010-11-10 09:20:14

回答

4

海友, 最後我得到了這個問題的解決方案,請參閱我的XML代碼

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/LinearLayout02_img" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:layout_gravity="center" 
    android:layout_alignParentBottom="true" 
    android:background="@color/black" 
       android:layout_alignParentLeft="true">    

    <WebView android:id="@+id/ads_content" 
    android:layout_gravity="center" 
    android:scaleType="centerInside" 
    android:layout_width="wrap_content" 
    android:layout_height="fill_parent" 

    android:adjustViewBounds="true"> 
</WebView> 
</LinearLayout> 
0

你可以試試將WebView佈局設置爲單列。它將所有圖像自動調整爲屏幕寬度。

webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);

從我的回答here

相關問題