Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 图像按钮,图像资源_Android_Android Layout_Android Widget - Fatal编程技术网

Android 图像按钮,图像资源

Android 图像按钮,图像资源,android,android-layout,android-widget,Android,Android Layout,Android Widget,我正在使用android ImageButton,我想调整图像大小,使其等于按钮上的默认图像,我认为是48像素乘以48像素 但图像仍然没有覆盖整个按钮,我可以看到一些灰色区域 所以我的问题是,我完全覆盖图像按钮的图像的分辨率应该是多少。imagebutton的大小将是默认值。您应该将imagebutton的背景设置为空。 android:background=“@null”您应该将ImageButton的背景设置为null。 android:background=“@null”就个人而言,我更喜

我正在使用android ImageButton,我想调整图像大小,使其等于按钮上的默认图像,我认为是48像素乘以48像素

但图像仍然没有覆盖整个按钮,我可以看到一些灰色区域


所以我的问题是,我完全覆盖图像按钮的图像的分辨率应该是多少。imagebutton的大小将是默认值。

您应该将imagebutton的背景设置为空。
android:background=“@null”

您应该将ImageButton的背景设置为null。
android:background=“@null”

就个人而言,我更喜欢使用和
ImageView
作为按钮来避免您遇到的灰色边框问题。就个人而言,我更喜欢使用和
ImageView
作为按钮来避免您遇到的灰色边框问题。