Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: Simple layout issue
    text
    copied!<p>This is probably a simple layout question but I'm being able to get what I want.</p> <p>I have one LinearLayout (which is horizontal), and I want to display 2 Layouts inside, one on the left, and one of the right (which themselves have overlay, buttons, etc...). I want the right one to ALWAYS be displayed fully, and the left one to be displayed only after the right is completely displayed, if space permit.</p> <p><strong>UPDATE</strong></p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="20dp" &gt; &lt;RelativeLayout android:layout_width="0px" android:layout_height="match_parent" android:layout_weight="1" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="match_parent" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:singleLine="true" /&gt; &lt;/RelativeLayout&gt; &lt;RelativeLayout android:layout_width="wrap_content" android:layout_height="match_parent" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="match_parent" /&gt; &lt;TextView android:layout_width="match_parent" android:layout_height="match_parent" android:background="#000111" /&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" /&gt; &lt;ImageView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_centerVertical="true" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>With this code, only the left side gets displayed. If I change the weight of the first RelativeLayout to 1, then both take 50% of the screen which is what I expect.</p> <p>What I would please like is the right to take, if needed 100%, and if it takes less then 100%, whatever is left gets used for the left one. How can I do this please?</p> <p>Thanks a lot!</p>
 

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