Android Question How can i put the image into the edittext?

Keith Yong

Active Member
Licensed User
Longtime User
Is the anyway for me to create the textbox with the image file base on the picture given?
 

Attachments

  • Screen Shot 2018-05-18 at 5.40.51 PM.png
    19 KB · Views: 192

Keith Yong

Active Member
Licensed User
Longtime User
No
You need to build this by yourself.

Create a Panel with an Imageview at the beginning and a Edittext right from it.
You also can use a simple label and use CSBuilder to add a Fontawsome Icon to it...

ooo. Thanks for the idea given.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
In prior versions of Android I used resource drawables to set it:
B4X:
Public Sub SetEditTextIcon(TextBox As EditText)
    Dim Bmpd As BitmapDrawable
    Dim poPhone As Phone
    Dim ST As String
    
    
    Bmpd = poPhone.GetResourceDrawable(17301583) 'ic_menu_search
    'Add to edittext1
    ST="android.graphics.drawable.Drawable"
    Dim R As Reflector
    R.Target = TextBox
    R.RunMethod4("setCompoundDrawablesWithIntrinsicBounds",Array As Object(Bmpd,Null,Null,Null),Array As String(ST,ST,ST,ST))
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…