2011-11-20 179 views
1

我正在嘗試爲我的應用程序創建啓動畫面,但圖像不斷剪裁到屏幕中央的正方形。 Eclipse中「圖形佈局」選項卡中的屏幕模型看起來不錯,但是當我在模擬器或手機上測試它時,圖像被裁剪/裁剪爲屏幕中央的正方形。如何防止imageview中的圖像被裁剪爲正方形?

模擬器的屏幕截圖可用here

這個代碼是:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/relativeLayout1" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" > 

<ImageView 
    android:id="@+id/imageView2" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:src="@drawable/digitalorange" /> 

</LinearLayout> 
+1

您正在開發哪個Android版本和API級別? –

+0

是你在活動xml中擁有的所有代碼嗎?您是否嘗試將ImageView放入RelativeLayout或FrameLayout中以縮小問題空間? –

+0

我試過相對和框架,但沒有幫助。我在2.3.3工作(我認爲是10級)。這就是splashscreen.xml中的所有代碼。 – mikeagoff

回答

0

嘗試加入android:scaleType="fitXY"ImageView,看看它給你想要的東西。

+0

這沒有幫助。我仍然在模擬器中獲得相同的結果。在「圖形佈局」選項卡中,它會扭曲圖像,因爲它沒有按比例拉伸。 – mikeagoff