How can I make an image transparent on Android?

后端 未结 12 1532
春和景丽
春和景丽 2021-01-30 19:52

I am using a linear layout and frame layout. In the linear layout I keep an image as background and in the frame layout I keep an imageView. In that imageView I give an image.

12条回答
  •  滥情空心
    2021-01-30 20:31

    Image alpha sets just opacity to ImageView which makes Image blurry, try adding tint attribute in ImageView

     android:tint="#66000000"
    

    It can also be done programatically :

    imageView.setColorFilter(R.color.transparent);
    

    where you need to define transparent color in your colors.xml

    #66000000
    

提交回复
热议问题