2011-12-24 23 views
0

私は、タブレットデバイスと電話機の両方に使用したい大きなヘッダイメージを持っています。画像は、タブレット上で正常に見えるが、携帯電話で見たとき、それは次のようになります。私は、両方の画面に正しくスケールするこのヘッダー画像を取得できますかレイアウトで不適切なヘッダ配置

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@color/white" 
    > 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/searchresults_header" /> 

    <ListView 
     android:id="@+id/android:list" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     /> 


</LinearLayout> 

:ここenter image description here

は私のレイアウトXMLでありますサイズ?

答えて

1

あなたのイメージは自動的にリサイズ取得されてみてください、しかし、彼らはもともとあったようviewboundsは滞在することはできません。

あなたImageViewにこれを追加し、あなたは違いが表示されるはずです。

android:adjustViewBounds="true"

関連する問題