Android transparent canvas (surfaceview)

前端 未结 4 1438
萌比男神i
萌比男神i 2020-12-08 12:08

I\'ve got a panel which is placed on top of another view via a relativelayout.

I would like to give this panel a transparent background, but didn\'t find the correct

4条回答
  •  温柔的废话
    2020-12-08 13:00

    After searching with keyword surfaceview instead of canvas iI found out that it isn't possible. For more information see: how to make surfaceview transparent

    Because the background of the canvas is static I've gave it the exact same background. Now it looks like it is transparent :)

        Bitmap bg = BitmapFactory.decodeResource(getResources(), R.drawable.background_panel_800_480);
        canvas.drawBitmap(bg, 0, 0, null);
    

提交回复
热议问题