Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid align a view to the bottom right of a view
    primarykey
    data
    text
    <p><img src="https://i.stack.imgur.com/YoWvB.png" alt="Sample UI which I am trying"></p> <p>In the attached image I am trying to achieve the alignment of a ui button, I have quite successfully done that but the issue is, its not quite reliable across different screen sizes. I did it with the help of attribute <strong>"android:layout_marginRight="60dp""</strong> which is causing issue ("Login" button moves to the right) if I view it on big resolution screen. </p> <p>And yes I have few more UI View below that login button, (which I have not included in image).</p> <p>How to generically achieve this layout? <strong>UPDATED:</strong> XML layout schema </p> <pre><code> &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="20dip" android:gravity="center_horizontal" android:orientation="horizontal" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dip" android:layout_marginTop="10dip" android:text="@string/login" android:textColor="@color/blue_txt" android:textSize="20sp" android:textStyle="bold" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:orientation="horizontal" &gt; &lt;EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dip" android:layout_weight="0.0" android:background="@drawable/rounded_edittext" android:ems="10" android:hint="Email or User name" android:typeface="serif" &gt; &lt;/EditText&gt; &lt;/LinearLayout&gt; &lt;EditText android:id="@+id/password" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dip" android:background="@drawable/rounded_edittext" android:ems="10" android:hint="Password" android:inputType="textPassword" android:textStyle="normal" android:typeface="serif" /&gt; &lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_marginRight="60dp" android:layout_marginTop="10dip" android:background="@drawable/loginpage_btn" android:text="@string/login_btn_text" android:textColor="@color/white" /&gt; &lt;/RelativeLayout&gt; &lt;TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="35dip" android:text="@string/login_no_account" android:textColor="@color/blue_txt" android:textSize="20sp" android:textStyle="bold" android:textStyle="bold" /&gt; &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dip" android:src="@drawable/login" /&gt; &lt;Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="10dip" android:background="@drawable/loginpage_btn" android:text="@string/login_signup" android:textColor="@color/white" /&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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