Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should only align one TextView based on the parent and the rest based on that one.</p> <p>Or put in other words, if you are not setting a <strong>layout_</strong> parameter, then you should align it with the parent so the view knows where to position itself. Now, the other views can use <strong>layout_</strong> parameters against the view that has an <strong>alignParent</strong> parameter.</p> <p>If you align all of them against the parent, they will just align keeping the parent in mind and not bother about the other TextViews.</p> <p>I like to imagine that they view that is aligned with the parent is a sort of "anchor" and the other ones position themselves against it. </p> <p>Try the following (I removed the to other parameters for <strong>readability</strong> not because you should remove them!)</p> <pre><code>&lt;TextView android:id="@+id/textView1" android:layout_alignParentLeft="true" /&gt; &lt;TextView android:id="@+id/secondLine" android:layout_below="@id/textView1" /&gt; //If You set it below, there's no reason to align it with the Parent // you can now use margins instead &lt;TextView android:id="@+id/thirdLine" android:layout_below="@id/textView2" /&gt; //Same scenario &lt;TextView android:id="@+id/textView2" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" /&gt; //In this case you DO need to align with parent because you are not setting a //layout_ parameter </code></pre> <p>I hope this helps guide you in the right direction. Also, keep in mind that if you change the values on the views with <strong>alignParent</strong> parameter, the other views that have a <strong>layout_</strong> parameter and will also change in position.</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. 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