Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add border to edittext control in android

i want to add a grey border to my edittext control. How do i add such a border, either via xml or programatically.

thank you in advance.

like image 632
user590849 Avatar asked Dec 06 '25 23:12

user590849


1 Answers

You need to make a nine-patch image and set it as a background of your EditText control:

<EditText android:background="@drawable/your_background"/>

It's better to use nine-patch because of its scaling capability.

like image 141
Michael Avatar answered Dec 08 '25 15:12

Michael



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!