David Bowen
David Bowen

Reputation: 49

Android: How to insert images into edit text

I am trying to create a blog type app, at the moment I am using an image button to get replaced with an image using the picasso libaray. Although, how would I go about adding/inserting image(s) from my gallery to an edit text. I am not sure how to go about doing this:

Something like this

Upvotes: 1

Views: 359

Answers (2)

Rafa
Rafa

Reputation: 3349

Try using imageView.setCompountDrawablesWithInstrinsicBounds(drawable, null, null, null)

This way you can dynamically pass in the images you want to display from a gallery.

Upvotes: 0

Abhi
Abhi

Reputation: 3511

Although the image isn't very clear in describing your question, you can however use the below code to add a drawable in EditText.

<EditText
...     
android:drawableLeft="@drawable/some_drawable"
android:drawablePadding="10dp"/>

Upvotes: 1

Related Questions