imageView显示图片的高度问题 布局文件如下: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <ImageView android:layout_width="match_parent" android:layout_height="10dip" android:src="#ff333333" /> <ImageView android:id="@+id/primaryImage" android:src="@drawable/test2" android:layout_width="match_parent" android:layout_height="wrap_content" /> <ImageView android:layout_width="match_parent" android:layout_height="10dip" android:src="#ff333333" /> </LinearLayout> 中间的图片距离上下两个黑色横条间会有一段距离呢?我中间图片的高度用的是wrap_content了,百思不得其解.... 想了好久,应该是图片的高度与宽度与ImageView高宽比不一样的原因,图片可以自动改变自己的宽高,而ImageView不行,所以布局中加入 android:adjustViewBounds = "true" 就可以了