Search code examples
androidsurfaceview

SurfaceView with color transparent


I need to have a background similar to this screenshot, I had a SurfaceView in my Fragment, I this line android:background="#80FFC107", but when I install the app I found only my SurfaceView without color.

enter image description here

Thanks


Solution

  • I found it, You should use a hex color with Two hexadecimal characters like : #66FFC107

    and surfaceview is :

     <SurfaceView
                android:id="@+id/cameraSurfaceView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#66FFC107"
                >