Android Question Button Corner Rounding

Dennis Glowack

Member
Licensed User
I've noticed that if I programmatically change the button color of a button that is designed with rounded corners, that the corner rounding reverts to square corners. Is there any way to stop this? My buttons were designed to use ColorDrawable in the Designer.

Thanks
 
Last edited:

Mahares

Expert
Licensed User
Longtime User
My buttons were designed to use ColorDrawable
You can re-generate the colordrawable programmatically with this code:
B4X:
Dim cd As ColorDrawable
cd.Initialize(Colors.Red, 15dip)  'you can also use Initialize2 with more parameters
Button1.Background =cd
Button1. text ="Dennis"
 
Upvote 0

Dennis Glowack

Member
Licensed User
You can re-generate the colordrawable programmatically with this code:
B4X:
Dim cd As ColorDrawable
cd.Initialize(Colors.Red, 15dip)  'you can also use Initialize2 with more parameters
Button1.Background =cd
Button1. text ="Dennis"

Thanks, I didn't know I could do this. It worked.
 
Upvote 0
Top