我为我的应用程序创建了一些自定义按钮。我不想为同一图像创建不同图像大小的负载以进行屏幕优化。我正在尝试按XML缩小图像,但是当我将参数更改为:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/one_default" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
这是给我的:

原始外观如下:

如何缩小图像而又不裁剪图像?