Skip to content Skip to sidebar Skip to footer

How To Set Linear Layout Child's Height As Tallest Child Height

I have four textviews in my Linear Layout and they have equal width as follows, Copy

Solution 2:

Checkout below xml Code , You set the child height to wrap_content that should be match_parent :

<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"><TextViewandroid:background="@drawable/bluebackground"android:layout_width="match_parent"android:layout_height="wrap_content"android:id="@+id/textView86" /><LinearLayoutandroid:background="@color/colorPrimaryDark"android:orientation="horizontal"android:layout_width="match_parent"android:layout_height="wrap_content"><TextViewandroid:background="@drawable/bluebackground"android:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"
            /><TextViewandroid:background="@drawable/bluebackground"android:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"
            /><TextViewandroid:background="@drawable/bluebackground"android:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"
            /><TextViewandroid:background="@drawable/bluebackground"android:layout_width="0dp"android:layout_weight="1"android:layout_height="match_parent"
            /></LinearLayout></LinearLayout>

Post a Comment for "How To Set Linear Layout Child's Height As Tallest Child Height"