2011-11-20 71 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