简体   繁体   English

去除android studio中jpg图片按钮周围的空白

[英]Remove the white space around the jpg image button in android studio

I'm trying to set an image button.我正在尝试设置图像按钮。 But when I use it on android studio, it has white space and has thick grey border around it.(its not visible when you view it in photos apk).但是当我在 android 工作室上使用它时,它有空白区域并且周围有粗灰色边框。(在照片 apk 中查看时不可见)。 I've used android:adjustViewBounds="true" attribute but it did not work.我使用android:adjustViewBounds="true"属性,但它不起作用。 How can I remove border and white space?如何删除边框和空白? (using android studio or other apk) (使用 android studio 或其他 apk)

code for imageboutton:图像按钮的代码:

<ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignParentBottom="true"
        android:adjustViewBounds="true"
        android:src="@drawable/add_button" />

This is how it looks in android studio / on phone:这是它在 android 工作室/手机上的样子:

在此处输入图像描述

And this is how it looks in photos apk(windows): [这就是它在照片 apk(windows) 中的外观:[在此处输入图像描述 ]2] ]2]

That's an ImageButton.那是一个图像按钮。 It's a button with an image.这是一个带有图像的按钮。 The gray border is the button.灰色边框是按钮。 If you don't want that and just want a clickable image, use ImageView instead of ImageButton如果您不想要那个并且只想要一个可点击的图像,请使用 ImageView 而不是 ImageButton

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM