我使用 Layout_width="fill_parent
" 和Layout_height="wrap content"
。如果图像大于 ImageView,它将被完美地缩小。
然而,我从来没有得到它的工作来放大较小的图像。我尝试了ScaleType和“AdjustViewBounds”的任意组合:它始终在图像视图的中间保持自己的大小。这是代码...
<LinearLayout
android:id="@+id/LinearLayout02"
android:layout_height="wrap_content"
android:background="@drawable/content_bg"
android:orientation="vertical"
android:padding="5dp"
android:layout_width="fill_parent"
android:layout_marginLeft="1px">
<ImageView
android:layout_height="wrap_content"
android:src="@drawable/test"
android:id="@+id/ImageViewTest"
android:layout_width="fill_parent"
android:adjustViewBounds="true"
android:scaleType="center"></ImageView>
</LinearLayout>