Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting the button radius programmatically in android

I have a button say myButton. I want to set the top left corner radius of the button programmatically. I'm looking for something like

myButton.setTopLeftCornerRadius(10);

I have looked for a method like 'setcornerradius' in eclipse but got nothing.

like image 803
jjpp Avatar asked Feb 04 '13 12:02

jjpp


1 Answers

You can use shape drawable for this or rounded corner background Image. For shape drawable detail please see this post.

How to set corner radiuses for the button in java code?

Cheers.

like image 193
Ashish Singh Avatar answered Nov 15 '22 04:11

Ashish Singh