3
Android developers, need to put an image at the beginning of input:
How can I do?
3
Android developers, need to put an image at the beginning of input:
How can I do?
1
To add an image in the left corner of edittext, you can add the property android:drawableLeft
in 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
.
0
What I did to resolve this issue did not involve 1 line of code just edited an image with the drawing on the side I wanted with the resolutions required for the android API.
Browser other questions tagged android
You are not signed in. Login or sign up in order to post.
Try setting an HTML code from
EditText
using the methodHtml.fromHtml()
using the tag<img>
, also use aImageGetter
to solve the image path. Also you need to ensure that the image will not be deleted (maybe it is worth using thehint
ofEditText
). I could not test, if I still have time I test and put a response.– Wakim
OK, I’ll test and await your return
– Furlan
@Wakim got, android:drawableLeft this is the code, end of topic
– Furlan
@Furlan, could you put the code as an answer? And then close the question?
– Reiksiel