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"/>
Hard
ReplyDelete