<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/colorBackground"
android:theme="@style/WidgetTheme">
<!-- ImageView for background image -->
<ImageView
android:id="@+id/backgroundImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<!-- Foreground content container -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:gravity="start">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="16dp"
android:baselineAligned="true"
android:gravity="start">
<!-- ImageView for icon -->
<ImageView
android:id="@+id/iconImage"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginEnd="8dp"
android:baselineAlignBottom="true"/>
<!-- TextView for city -->
<TextView
android:id="@+id/cityText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:fontFamily="sans-serif" />
</LinearLayout>
<!-- Temperature TextView -->
<TextView
android:id="@+id/tempText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="#FFFFFF"
android:textSize="24sp"
android:textStyle="bold"
android:fontFamily="sans-serif" />
<!-- Description TextView -->
<TextView
android:id="@+id/descriptionText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:fontFamily="sans-serif" />
</LinearLayout>
</LinearLayout>
My texts don’t visible. I see only my background image, but the other elements are invisible.
If I use RelativeLayout everything is ok. I see all my text, but I have to use linear layout (because of shape of my image)
So what’s the problem here?
Thanks in advance for help