6

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.

nilsi
  • 10,351
  • 10
  • 67
  • 79
jjpp
  • 1,298
  • 1
  • 15
  • 31

3 Answers3

1

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.

Community
  • 1
  • 1
Ashish Singh
  • 53
  • 11
0

Button is type of View and all Views in Android occupy rectangular areas. However, you can set the background of the button to any image you like. Like a Shape Drawable with round corners.

S.D.
  • 29,290
  • 3
  • 79
  • 130
0

Try this code for draw the rounded corners edittext:

How to create EditText with rounded corners?

Community
  • 1
  • 1
Android_coder
  • 9,953
  • 3
  • 17
  • 23