需要在Android的web视图中正确显示图像帮助? [英] Need Help in Displaying Image correctly in WebView in Android?

查看:136
本文介绍了需要在Android的web视图中正确显示图像帮助?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海Freinds,
             我已经从URL解析的形象,而在web视图中显示,当我在web视图中显示它,几图像streched,所以我的ImageView的帮助下显示的图像,但问题是图像不显示ImageView的时候颜色格式是CMYK格式,所以请告诉我如何显示网页视图图像而不图像strecth,不然我怎么可以显示的ImageView图像的所有格式。

Hai Freinds, I had parsed the image from the url, and displayed in the webview, when i am displayed it in webview, a few images were streched, so i displayed the image with the help of Imageview, but the problem is the Images are not displayed in Imageview when they Color format is CMYK format, so pls tell me how to display the image in a webview without strecth of the image,or how can i display all format of images in ImageView.

我的XML code是

My xml code is

<?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 code是

and My java code is

私人的WebView ads_content;
  ads_content =(的WebView)
  findViewById(R.id.ads_content);
  ads_content.loadUrl(URL);

private WebView ads_content; ads_content = (WebView) findViewById(R.id.ads_content); ads_content.loadUrl(url);

请参考这说明我的输出截图

Refer the screenshot which shows my output

我必须表现出高达设备级的形象,泰国是要阻止白色和黑色的空车位
谢谢

i have to show the image upto the device level, thai is to block that white and black empty spaces Thanks

推荐答案

海友,
           最后我得到这个问题的解决方案,请参阅我的XML code

Hai Friends, Finally i got the solution for this problem, refer my xml code

<?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>

这篇关于需要在Android的web视图中正确显示图像帮助?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆