4

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.

feisal
  • 585
  • 1
  • 8
  • 20

2 Answers2

8

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.

HalR
  • 11,411
  • 5
  • 48
  • 80
  • Changing the content opacity seems to not have any effect when TextureView is used in video playback. I want to have a semi-transparent video playback using TextureView. – feisal Sep 25 '13 at 19:31
  • 1
    Works perfectly with OpenGL stuff. – Ash Dec 01 '14 at 22:26
5

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.

feisal
  • 585
  • 1
  • 8
  • 20