Android Layout background alpha

前端 未结 4 1373
遥遥无期
遥遥无期 2021-01-31 18:26

Hi I have a layout which I\'m using to fill my page and I have to set a background image held in my drawable folder in that layout.

I want to then set the <

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-31 19:08

    Try to use:

    Drawable.setAlpha();
    

    You should do something like this:

    View backgroundImage = findViewById(R.id.background);
    Drawable background = backgroundImage.getBackground();
    background.setAlpha(80);
    

提交回复
热议问题