skip to Main Content

How do I add an image to an edit view in Android Studio something similar to this:
enter image description here

Where an image view shows up in an edit text view

I’ve thought of nesting views but that’s not an option in Android Studio or embedding a layout inside the edit view every time a picture gets added.

2

Answers


  1. Please take a look of this repo: https://github.com/1gravity/Android-RTEditor
    It might helps you.

    Login or Signup to reply.
  2. EditText is not a view group but a view, unlike Linear Layout or any other layouts. You can make use of ConstraintLayout and constraint the Image to the EditText.

    OR

    You can add this line to the EditText

    android:drawableStart="R.drawable.my_image"
    

    OR

    android:drawableEnd="R.drawable.my_image"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search