Вот мой макет координатора. Все в порядке, я все вижу.Добавить изображениеПросмотреть координаторуLayout
Но я не вижу ImageView. В коде я инициализирую ImageView правильно и имею объект. Мне нужен вид изображения в центре экрана.
Если я изменил ImageView на кнопку, я вижу кнопку в центре экрана, но если я перейду на что-то другое, я не смогу увидеть этот элемент.
Пожалуйста, как я могу добавить ImageView в координаторLayout?
Этот код находится в координаторе.
спасибо.
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<ImageView
android:id="@+id/status_btn"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_gravity="center"
android:background="@color/red" />
<Button
android:id="@+id/delete_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Smazat"
android:visibility="gone" />
<include
layout="@layout/panel_camera_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<!--height a width se nastavuje dynamicky-->
<LinearLayout
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="0dp"
android:clipToPadding="true"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
<RelativeLayout
android:id="@+id/bottom_sheet_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/header_vg"
android:layout_width="match_parent"
android:layout_height="@dimen/vision_bottom_sheet_header_height"
android:layout_alignParentTop="true"
android:background="@color/gray_header_vision"
android:gravity="center">
<TextView
android:id="@+id/header_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/vision_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/header_vg"
android:background="@color/white"
android:scrollbars="vertical"
android:visibility="gone" />
<include
android:id="@+id/empty_vg"
layout="@layout/panel_vision_tutorial"
android:layout_width="match_parent"
android:layout_height="@dimen/vision_bottom_sheet_item_height"
android:layout_below="@+id/header_vg" />
</RelativeLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Вот мой panel_camera_preview:
<my_package.CameraSourcePreview
android:id="@+id/camera_preview"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/darker_gray">
<my_package.GraphicOverlay
android:id="@+id/face_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</my_package.CameraSourcePreview>
Просьба предоставить всю схему, включая CoordinatorLayout. – Drv
Извините, я редактирую свой вопрос. Мне нужен вид изображения в центре экрана. Если я меняю ImageView на кнопку, я вижу кнопку в центре экрана, но если я перейду на что-то другое, я не смогу увидеть этот элемент. @Drv –
предоставить свой макет 'panel_camera_preview' .. !! –