我想将我的图像放在分配的图像按钮 View 中。但它并没有固定在那个空间里,看起来很奇怪! !是否可以将图像与分配给图像按钮的空间对齐,或者我必须裁剪和设置?
最佳答案
ImageButton 标签中的图像要左对齐。
<ImageButton
android:id="@+id/sample"
android:layout_gravity="left"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:scaleType="fitStart"
android:src="@drawable/sample" >
</ImageButton>
关于android - 如何对齐图像按钮中的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17120250/