I have a main layout in which I include two inner layouts. I am specifying the width of the included layouts to match_parent but they don't occupy the entire width of the parent.
See example below: main_layout.xml
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="5dp"
android:baselineAligned="false"
android:orientation="vertical" >
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.95" >
android:id="@+id/tableRow1"
android:layout_weight="0.8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp" >
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:id="@+id/tableRow2"
android:layout_weight="0.2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp" >
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="0.05"
android:gravity="center"
android:orientation="vertical">
android:layout_width="80dp"
android:layout_height="40dp"
android:textSize="14sp"
android:textStyle="bold"
android:text="Bottom" />
child_layout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
android:id="@+id/leftLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:orientation="vertical" >
android:layout_width="80dp"
android:layout_height="40dp"
android:textSize="14sp"
android:textStyle="bold"
android:text="Left" />
android:id="@+id/rightLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:orientation="vertical" >
android:layout_width="80dp"
android:layout_height="40dp"
android:textSize="14sp"
android:textStyle="bold"
android:text="Right" />
Notice that the left and right buttons are overlapped in the image.. How do I expand the included layout to fill the entire width of the parent so that the left and right buttons appear on left and right. Thank You.
.
stackoverflow.comm
No comments:
Post a Comment