I have created this main XML file in my project. I have parsed XML file and displayed dynamically in linear layout1. But linearlayout2 is not displaying in my result. please help me. This is my main XML file . I am using one XML file to display my widgets
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout1"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/linearlayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="horizontal" >
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_weight="1"
android:gravity="bottom"
android:text="Signature" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="30dp"
android:layout_toRightOf="@+id/button2"
android:layout_weight="1"
android:gravity="bottom"
android:text="Submit" />
</LinearLayout>
</LinearLayout>
copy and paste this layout, its modified by adding layout_weight in your scroll view and linearlayout2 to equally distribute the screen. Hope it fulfills your requirements.