So I want to make my button have white edges/border with a black background, is there a simple solution to do this in my xml?
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.
Yup! Make a new XML file in your res/drawable directory, and then create a shape drawable via XML. Here’s an example for a 3-px rounded black rectangle with a 2-px white border:
Then just set this drawable as the background of your button, for example:
The developer site has a great reference on creating Shape Drawables via XML.