Note that there are some explanatory texts on larger screens.

plurals
  1. POLinearLayout: layout_gravity="bottom" not working on Horizontal LinearLayout
    primarykey
    data
    text
    <p>Ok, First of all, I searched all the internet, but nobody has a similar problem like this. So, all I want is to have 3 textViews, bottom aligned with the screen and with the same width. Here is an image representing what I want:</p> <p><img src="https://i.stack.imgur.com/aVhkF.png" alt="enter image description here"></p> <p>And here is my code:</p> <pre><code> &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true"&gt; &lt;TextView android:text="@string/help_1" android:layout_weight="0.33" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/mynicebg1" android:layout_gravity="bottom"/&gt; &lt;TextView android:text="@string/help_2" android:layout_weight="0.33" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/mynicebg2" android:layout_gravity="bottom"/&gt; &lt;TextView android:text="@string/help_3" android:layout_weight="0.33" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/mynicebg3" android:layout_gravity="bottom"/&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>Well, it works when the 3 textViews have the same height, but when their size differ, I get the following result:</p> <p><img src="https://i.stack.imgur.com/FvEsu.png" alt="problem"></p> <p>Another strange behavior, is that when I set the layout_gravity of the biggest text to "center-vertical", I get the following result:</p> <p><img src="https://i.stack.imgur.com/Yq6bI.png" alt="first workaround"></p> <p>So obviously, I went crazy and tried another combinations with center-vertical, but nothing worked as I wanted initially:</p> <p><img src="https://i.stack.imgur.com/qZbVy.png" alt="desperation workaround"></p> <p>So, any tips on how to solve this?</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.
 

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