Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yep, easy actually.</p> <p>First cell must have the weight of 0. Second cell must have the weight of 1 and fill the parent by width. That way it will take up the remaning space within the container it's in.</p> <p>Easy! Here's an example for your convenience</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="0" android:background="#FF0000"&gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="SomeText" android:id="@+id/theview"/&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="#FFFF00"&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>=======================================</p> <h1>UPDATE</h1> <p>Mate you overcomplicated it like Crayze!</p> <p>First. You don't need a table layout for that.</p> <p>Second the problem is you set both heights of the layout to fill_parrent. So they are both fighting over for the screen size. To fix this you just have to set both the layout sizes to wrap_content. That will work just fine. Here have an example, without the table on your code.</p> <pre><code>&lt;LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="#FF0000"&gt; &lt;ListView android:id="@+id/edit_group_listView" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="0" android:background="#FFFF00"&gt; &lt;Button android:text="@string/button_save" android:id="@+id/edit_group_save" android:layout_width="150dip" android:layout_height="50dip" android:enabled="false" android:layout_column="1"&gt;&lt;/Button&gt; &lt;Button android:text="@string/button_cancel" android:id="@+id/edit_group_cancel" android:layout_width="150dip" android:layout_height="50dip" android:layout_column="3"&gt;&lt;/Button&gt; &lt;/LinearLayout&gt; </code></pre>
    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.
 

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