Skip to content
Advertisement

Inserting imageview inside edittext android

I want to place imageview inside edittext. Would it be possible? I checked “evernote” application, and it was able to put photo on the edittext part. I want to make my application exactly as same. How would I be able to put imageview that was chosen from the gallery, and place the photo inside edittext?

I first tried to put imageview inside relativelayout in .xml file, but it threw me a error sign.

Should I do on .xml file? Or should I make my own edittext java file in order to do that?

Advertisement

Answer

Use this:

JavaScript

you can use drawable left,right,top or bottom of your text according to your need.

To manipulate in java use this:

JavaScript

for manipulating image set on right:

JavaScript

similarly you can do it for other cases.

Hope it helps!!!

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement