How to create an EditText that has rounded corners instead of the default rectangular-shaped corners?
How to create an EditText that has rounded corners instead of the default rectangular-shaped
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is an easier way than the one written by CommonsWare. Just create a drawable resource that specifies the way the
EditTextwill be drawn:Then, just reference this drawable in your layout:
You will get something like:
Edit
Based on Mark’s comment, I want to add the way you can create different states for your
EditText:These are the states:
And… now, the
EditTextshould look like: