Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could try using layout weights to control the relative sizes of the child layouts. There is an <a href="http://blog.stylingandroid.com/archives/111" rel="noreferrer">article on my blog</a> which gives some information on the use of layout weights.</p> <p>As an example, try this:</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="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;LinearLayout android:id="@+id/category" android:layout_width="fill_parent" android:layout_height="50dp" android:orientation="horizontal" &gt; &lt;ImageView android:id="@+id/back_btn" android:layout_width="29dp" android:layout_height="34dp" android:layout_gravity="center_vertical" /&gt; &lt;TextView android:id="@+id/cat_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:gravity="center" android:textSize="20sp" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/category" android:layout_marginTop="10dp" android:layout_weight="1" android:orientation="horizontal" &gt; &lt;ListView android:id="@+id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/white" android:cacheColorHint="@android:color/white" /&gt; &lt;TextView android:id="@+id/android:empty" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/white" android:cacheColorHint="@android:color/white" android:padding="10dp" android:text="no_item" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/nav_bar" android:layout_width="fill_parent" android:layout_height="40dp" android:orientation="horizontal" &gt; //stuff &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>The <code>RelativeLayout</code> has been replaced by a <code>LinearLayout</code>, all of the relative positioning tags have been removed, and a <code>layout_weight</code> attribute has been added to the centre <code>LinearLayout</code> which will cause it to stretch to fill the available space.</p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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