2010-03-01 82 views
-1

我在android中添加了图像,但它适合屏幕中间,我能做些什么来设置它的全屏?android resize image

什么是wrap_content和填充父,我没有得到如何做到这一点。

这是我的代码

<ImageView 
    android:scaleType="fitCenter" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/my_image" android:cropToPadding="false"/> 

回答

0

查找scaleType

<ImageView android:scaleType="fitCenter" /> 
+0

我已经试过相同的仍然相同 – savitha 2010-03-01 11:20:04

+1

看看这里:http://developer.android.com/intl/de/reference/android/widget/ImageView.ScaleType.html 也许你需要android:scaleType = “fitXY” 尝试参考中提到的一切,你应该能够找到你需要的东西 – WarrenFaith 2010-03-02 09:20:32

+0

这可能有助于你http://thinkandroid.wordpress.com/2009/12/25/resizing-a-bitmap/ – 2011-08-10 10:18:23

2

试试这个

android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:scaleType="center" 

WRAP_CONTENT说的ImageView,以适应图像尺寸和FILL_PARENT以适应父亲的布局尺寸。

+0

我将图像设置为特定的x和y坐标? – 2012-08-21 05:36:24