Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd background image while remain RelativeLayout
    primarykey
    data
    text
    <p>This is my *activity_login.xml* </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/RelativeLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:useDefaultMargins="true" tools:ignore="ExtraText" &gt; &lt;TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/userid" android:layout_centerHorizontal="true" android:text="@string/userid" android:textSize="20sp" /&gt; &lt;TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/password" android:layout_centerHorizontal="true" android:text="@string/password" android:textSize="20sp" /&gt; &lt;EditText android:id="@+id/userid" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/textView3" android:layout_alignRight="@+id/password" android:ems="10" android:inputType="textPersonName" /&gt; &lt;Button android:id="@+id/login" android:layout_width="100dp" android:layout_height="50dp" android:layout_above="@+id/newuser" android:layout_alignRight="@+id/textView3" android:layout_marginBottom="27dp" android:gravity="center" android:text="@string/button_login" /&gt; &lt;EditText android:id="@+id/password" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/login" android:layout_centerHorizontal="true" android:layout_marginBottom="25dp" android:ems="10" android:inputType="textPassword" /&gt; &lt;Button android:id="@+id/register" android:layout_width="100dp" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="42dp" android:gravity="center" android:text="@string/button_register" /&gt; &lt;TextView android:id="@+id/newuser" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/register" android:layout_centerHorizontal="true" android:layout_marginBottom="14dp" android:text="@string/newuser" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>I want <strong>pos_malaysia.png</strong> to be set as my login page background on the top center on the screen.. I saw some of them say use <code>&lt;bitmap&gt;</code> .</p> <p>The thing is when I replace <code>RelativeLayout</code> with <code>bitmap</code> all the <code>android:layout_above="@+id/userid"</code> and <code>android:layout_centerHorizontal="true"</code> cannot be used since its only applies for RelativeLayout. what should I do to maintain the layout with added background?</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