【发布时间】:2014-05-28 09:37:38
【问题描述】:
我有一个非常大的图像(超过 1000 像素超过 1000 像素),当我做一个图像按钮并将图像放入其中时,我无法看到整个图像。 如何更改图像的百分比,以便在不更改 px 本身的情况下呈现它?
改变 layout_height 和 layout_width 只是改变图像按钮本身的实际大小,而不是图像大小。
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/black" />
或
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="40dp"
android:layout_height="40dp"
android:scaleType="center"
android:src="@drawable/black" />
对我没有帮助...
【问题讨论】:
-
将 android:scaleType="fitXY" 添加到图像..
-
你不应该将这么大的图像放在图像按钮中。
标签: android image imageview imagebutton