2012-05-18 91 views
0
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/LinearLayout1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

<ImageView 
    android:id="@+id/imageView1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center_vertical" 
    android:scaleType="fitXY" 
    android:adjustViewBounds="true" 
    android:layout_x="0dip" 
    android:layout_y="0dip" 
    android:background="@drawable/mlview1" /> 

如何顯示圖像以適合整個屏幕?

我使用的是Android模擬器2.2。我的圖像水平佔用屏幕,但垂直顯示與底部有較大差距。圖像大小是800X600。是否應該重新調整大小然後再使用?

+0

請註明斯爾詹,如果你ACC epted他的回答 –

回答

1

確保:
1.高度和寬度上都父母和孩子是FILL_PARENT
2.您設置SRC財產,而不是背景一個圖像上

注意:您也不需要layout_x也不layout_y

+0

非常感謝!有效! :) – Shiven