I want to set the rounded corners without xml. How can I do it in java code?
Button b = new Button (this);
b.set???? (??) ;
I tried to write b.setCornerRadius(3.0f), but it is undefined for button object.
Thanks.
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.
create a shape in your drawable folder and set the desired radius and set this drawable as background to your button: