2017-01-12 26 views
0

我得到的图像从URL,但它与屏幕不作为浏览器的表现拟合...好心help..i试图everything..this网址 “http://i.imgur.com/DvpvklR.png” 这里是图像enter image description here如何使URL图像适合Android屏幕?

如果我们运行在浏览器的URL,我们可以看到谓我的设备上对其稍加upside..i希望它看起来完美的我的设备

这里是我的xml文件:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 

    > 


    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:orientation="vertical"> 

     <LinearLayout 
      android:id="@+id/linearLayout1" 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="0.7"> 

      <ImageView 
       android:id="@+id/ms1" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:scaleType="fitXY" 
       android:src="@drawable/main1" /> 


     </LinearLayout> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="0.3"> 


      <ImageView 
       android:id="@+id/ms2" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_weight=".5" 

       android:scaleType="fitXY" 

       android:src="@drawable/pl2" /> 

      <ImageView 
       android:id="@+id/ms3" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_weight=".5" 
       android:scaleType="fitXY" 
       android:src="@drawable/l1" /> 
     </LinearLayout> 
    </LinearLayout> 


</RelativeLayout> 
+0

是否要将图像设置为屏幕的背景图像,并将其他图像设置为背景图像? – fluffyBatman

+0

不是这是第一张图片其他下面的图片是第2张和第3张 –

+0

没有背景图片其主屏幕图片 –

回答

0

添加到您的ImageView,

   android:adjustViewBounds="true" 
       android:layout_alignParentBottom="true" 
       android:layout_alignParentTop="true" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentRight="true" 
+0

不,它仍然相同 –

+0

wotever图像我采取在url它略微上涨 –

+0

清理您的项目,然后再试 –

1

您可以使用库称为滑行为此目的

+0

如何使用它到代码...因为我有使用picasso的url图像 –

+0

即时通讯新的android ..所以不要多读取它...如果你告诉我通过编码它它wud b grt –

+0

wotever图像我采取在url它略有上升 –

0

看看它是否工作。

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 


    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical"> 

     <LinearLayout 
      android:id="@+id/linearLayout1" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <ImageView 
       android:id="@+id/ms1" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:scaleType="fitXY" 
       android:adjustViewBounds="true" 
       android:src="@drawable/main1"/> 


     </LinearLayout> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="1"> 


      <ImageView 
       android:id="@+id/ms2" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_weight=".5" 
       android:scaleType="fitXY" 
       android:src="@drawable/pl2"/> 

      <ImageView 
       android:id="@+id/ms3" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_weight=".5" 
       android:scaleType="fitXY" 
       android:src="@drawable/l1"/> 
     </LinearLayout> 
    </LinearLayout> 


</RelativeLayout> 
+0

不只是显示单个图像..但顶部仍然是切割 –

+0

我编辑答案发布后立即。你可以再试一次吗? – fluffyBatman

+0

仍然d相同... –