How to set transparent background for Image Button in code?

前端 未结 7 553
醉话见心
醉话见心 2020-12-25 09:03

I can set ImageButton background transparent in layout.xml using:

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

How I can

相关标签:
7条回答
  • 2020-12-25 10:08

    Do it in your xml

    <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/imageButtonSettings"
            android:layout_gravity="right|bottom"
            android:src="@drawable/tabbar_settings_icon"
            android:background="@android:color/transparent"/>
    
    0 讨论(0)
提交回复
热议问题