Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set weight for included layouts?
    primarykey
    data
    text
    <p>I have two xml files, header and footer as shown below</p> <p>header.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#9d1246" &gt; &lt;Button android:id="@+id/button_backfromreg" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_marginLeft="20dp" android:layout_marginTop="10dp" android:background="@drawable/backbtn" android:visibility="visible" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>footer.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#9d1246" &gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>I have included the above two layouts in my mainlayout as shown</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#eaedf2" android:orientation="vertical" &gt; &lt;include android:layout_weight="1" layout="@layout/header" /&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_margin="30dp" android:layout_weight="1" android:orientation="vertical" &gt; &lt;EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:editable="false" android:ems="10" android:hint="Country" android:textColor="#655e5e" android:textSize="15sp" &gt; &lt;requestFocus /&gt; &lt;/EditText&gt; &lt;EditText android:id="@+id/editText2" android:layout_width="match_parent" android:layout_height="wrap_content" android:editable="false" android:ems="10" android:hint="State" android:textColor="#655e5e" android:textSize="15sp" /&gt; &lt;EditText android:id="@+id/editText3" android:layout_width="match_parent" android:layout_height="wrap_content" android:editable="false" android:ems="10" android:hint="Place Keyword" android:textColor="#655e5e" android:textSize="15sp" /&gt; &lt;/LinearLayout&gt; &lt;include android:layout_height="0dp" android:layout_weight="1" layout="@layout/footer" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>My problem is that, using the above layout i cant see the footer. Anyone please help me. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload