this is the "login .xml" ------------------------- In this login page, how do I insert image 1.png ,make it display in the file.
this is the "login .xml"
<!--Login activity layout-->
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity7">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FF4500"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="login page"
android:textColor="@color/white"
android:textSize="25dp" />
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/1.png"
android:layout_gravity="center"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="190dp"
android:layout_marginTop="55dp">
<TextView
android:id="@+id/ema"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:text="Email"
android:textSize="15dp"
/>
<EditText
android:id="@+id/ed1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="15dp"
android:layout_marginRight="15dp"
android:hint="123@exa.com" />
<TextView
android:id="@+id/emat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ema"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:text="Password" />
<EditText
android:id="@+id/ed2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ema"
android:layout_alignParentRight="true"
android:layout_marginTop="6dp"
android:layout_marginRight="13dp"
android:hint="alphabets only" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ed2"
android:layout_alignParentRight="true"
android:layout_marginRight="30dp"
android:backgroundTint="#FF4500"
android:onClick="login"
android:padding="10dp"
android:text="Login" />
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textviww"
android:textSize="15dp"
android:layout_marginTop="15dp"
android:textColor="#FF0000"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="200dp"
android:text="try" />
</LinearLayout>
-------------------------
In this login page, how do I insert image 1.png ,make it display in the file.
Step by step
Solved in 2 steps