2
I want to add two icons to Edittext from android according to the image below.
This is the code I’ve used to add the image to the right side.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/imageView1"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/editText1"
android:layout_alignBottom="@+id/editText1"
android:layout_alignRight="@+id/editText1"
android:src="@drawable/icon_enter" />
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:background="@drawable/edittext_bottom_line">
</EditText>
</RelativeLayout>
To place the two images in Edittext how should I proceed?
This is the correct way to solve the question of the author.
– itscorey
I solved this way, using the two elements drawableLeft and drawableRight. android:drawableLeft="@drawable/icon_cadeado_little" android:drawableRight="@drawable/icon_enter_little"
– José Leal Marques