Я хотел бы иметь горизонтальный LinearLayout
, содержащий SurfaceView
и View
в качестве содержимого моего Fragment
. Допустим, они должны покрывать весь экран, иметь одинаковый размер по ширине и высоте.
Когда я пытаюсь это сделать, я получаю только SurfaceView
, который покрывает весь экран, что заставляет меня задуматься, возможно ли смешайте SurfaceView
и другой View
.
Кто-нибудь знает, возможно ли это и, если возможно, как это должно быть сделано?
Мой файл макета:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<SurfaceView
android:id="@+id/SurfaceView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="5dp"></SurfaceView>
<FrameLayout
android:id="@+id/AV"
android:layout_width="wrap_content"
android:layout_height="match_parent"
tools:visibility="visible">
<ImageView
android:id="@+id/FAV"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
app:srcCompat="@drawable/fond_vertical" />
<ImageView
android:id="@+id/CV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:srcCompat="@drawable/curseur" />
</FrameLayout>
</LinearLayout>