No input image

3

Android developers, I need to put an image at the beginning of the input:

How can I do this?

    
asked by anonymous 09.06.2014 / 16:21

2 answers

1

To add an image to the left corner of edittext, you can add the android:drawableLeft property to your XML.

Example:

<EditText 
    android:id="@+id/editSenha"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="10dp"
    <!-- AQUI É ONDE DEFINO O ICONE -->
    android:drawableLeft="@drawable/icon_lock"
    android:inputType="textWebPassword"/>

If you want to add on the right side, android:drawableRight .

    
23.09.2014 / 19:19
0

What I did to solve this issue did not involve 1 line of code I just edited an image with the drawing on the side I wanted with the necessary resolutions for the android API.

    
27.06.2014 / 04:06