How to add Image and Edit-text in Android Studio | Edit Text | Android Studio.

How to add Image and Edit-text in Android Studio.


Step:-
1)Open the Android Studio.
2)Copy the image and paste in a drawable folder in res.
3) Then the go-to Layout.
4)Write the code and set the path for image(src:).
5)Then run the emulator(check the output).
6)Then Come again Layout and write the code for Edit text.
7)Again run the emulator(check the output).

Code:-
1) Image Refer src:-
android:src="@drawable/logo"

2) xml code image
 <ImageView
            android:layout_width="225dp"
            android:layout_height="204dp"
            android:layout_margin="20dp"
            android:layout_gravity="center"

            android:src="@drawable/logo"/>

3) xml code edit-text

<EditText
        android:layout_width="match_parent"
        android:hint="Username"
        android:textAlignment="center"
        android:textSize="30dp"
        android:textColor="#000"
        android:fontFamily="sans-serif-condensed-light"
        android:layout_height="50dp"/>

Comments

Post a Comment

Popular posts from this blog

Samsung Galaxy F62 | Samsung Galaxy F62 with 6.7-inch FHD+ AMOLED Infinity O Display, Exynos 9825, 7000mAh battery launched in India starting at Rs. 23999

How to install Pip pillow | Install Pip Pillow | Python pip | Python pillow tutorial