Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Semi-Transparent TextureViews not working

I cannot change the transparency of a TextureView by setAlpha method to maske it semi-transparent as it is promised by the android SDK. For example mTextureView.setAlpha(0.5f) does not have any effect.

like image 991
feisal Avatar asked Dec 11 '22 11:12

feisal


2 Answers

You need to make sure and setOpaque(false).

From the docs:

public void setOpaque (boolean opaque) Added in API level 14

Indicates whether the content of this TextureView is opaque. The content is assumed to be opaque by default.

like image 156
HalR Avatar answered Dec 21 '22 09:12

HalR


The solution I used to make it happen was to wrap the TextureView in another widget like RelativeLayout and change the transparency of the parent.

like image 26
feisal Avatar answered Dec 21 '22 10:12

feisal