Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create background image with margin on EditBox

I'm trying to create a EditText box, like below which has a image on the left hand side and editable text region on the right hand side, but I don't seem to have the slightest clue how to do this in android :| I can find various solutions for putting an image in the background (so the text can overwrite it) and also how to make the rounded corners, but I cannot find a way to put the image on the left and the text on the right.

Any pointers would be very much appreciated!

EditText with background image

like image 347
John Mitchell Avatar asked Mar 22 '26 02:03

John Mitchell


1 Answers

Make a background graphic including the image and the border with the rounded corners. Make an EditText with this graphic as background and adjust the EditText with the android:paddingLeft/Top/Right/Bottom properties.

like image 136
CodeDownZero Avatar answered Mar 24 '26 17:03

CodeDownZero



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!