setting transparency to buttons in android

前端 未结 12 1096
悲&欢浪女
悲&欢浪女 2021-02-03 23:28

I want to make Buttons with different transparency levels in android.I have used \"@android:color/transparent\". But it makes the button 100% transparent. I need a

12条回答
  •  遥遥无期
    2021-02-04 00:13

    You can set transparency with color. In Android color is broken into 4 8-bit (0-255) segments, with the first 8-bit (0-255) controlling the alpha. For example with the basic color code for Light Gray: D3D3D3. If I want light grey transparent, add 0 and to light grey and get 0D3d3d3 for 100% transparent, or 227(E3 in hex) and get E3D3D3D3 for 50% or 255(FF in Hex) and get FFD3D3D3 for 0%

提交回复
热议问题