Android 扩大ImageView的点击区域
以前ImageView的布局写法:
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/left" />
完美解决方法:
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/left"
android:scaleType="centerInside"/>
android:scaleType=”centerInside”为不变形拉伸
需要注意的是: 要使用 src 不能使用background 否则图像会被拉伸
版权声明:本文为codekxx原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。