Android FrameLayout not visible inside CoordinatorLayout

26 views Asked by At

I am working on an Android application and facing an issue where my FrameLayout, which is supposed to act as a bottom sheet, is not visible. I have nested the FrameLayout inside a CoordinatorLayout, which is, in turn, nested inside a ConstraintLayout. Below is the relevant portion of my XML layout:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:background="@color/card_bg">
    
    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="parent">

        <FrameLayout
            android:id="@+id/fragment_introduction_sheet"
            android:layout_width="match_parent"
            android:layout_height="360dp"
            android:background="@color/app_background"
            app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

            <ImageView
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:scaleType="fitXY"
                android:layout_gravity="center|top"
                android:src="@drawable/ic_minimize"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent" />

        </FrameLayout>
        
    </androidx.coordinatorlayout.widget.CoordinatorLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

ic minimize:

<vector android:height="24dp" android:tint="#FFFFFF"
    android:viewportHeight="24" android:viewportWidth="24"
    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="@android:color/white" android:pathData="M6,19h12v2H6z"/>
</vector>
0

There are 0 answers