Я пытаюсь разработать приложение для распознавания лиц и использую SurfaceView внутри RelativeLayout.Мне удалось сделать SurfaceView «ПРОЗРАЧНЫМ», поэтому мне не нужно было видеть предварительный просмотр камеры, но теперь у меня белый фон, вызванный RelativeLayout, и я не могу сделать его невидимым, поэтому я не вижу этот фон вмое приложение.
Я перепробовал много вещей и просмотрел здесь много постов в SO, но я не нашел решения для своей ситуации.
XML-код (поля в относительной разметке и на поверхности былидля тестирования):
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:visibility="invisible">
<SurfaceView
android:id="@+id/surfaceview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="100dp"
/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="@dimen/image_preview"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_margin="10dp"
android:scrollbars="vertical" />