使按钮的背景透明 [英] Make a Button's background transparent

查看:77
本文介绍了使按钮的背景透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Android Studio和创建应用程序非常陌生.我创建了一个图像按钮并上传了一个图像,问题是我想使按钮的背景透明.这就是我的意思:

  • 单击小图标图像(位于ic_android_black_24dp下方)

  • 搜索任何图标,然后将其添加到您的可绘制对象中.您正在使用的图标出现在搜索结果中.使用此列表图标.

  • I am very new to Android Studio and creating apps in general. I have created an Image Button and uploaded an Image, problem is that I want to make the background of the Button transparent. This is what I mean:See Example

    The background of the left button is black and I want to make it transparent, like the Right Button.

    解决方案

    Just put this property inside ImageButton tag:

    android:background="@android:color/transparent"
    

    ----------OR--------------

    You can also user vector image for this:

    1. Click on Vector Asset

    2. Click on small icon image(just below ic_android_black_24dp)

    3. Search any icon and add to your drawable. The icon you are using is appeared in search result. use this list icon.

    这篇关于使按钮的背景透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆