Delete border of software-created custom button

I know to set the border for a button in the following ways,

button.layer.cornerRadius = 0.0;
button.layer.borderWidth = 2.5;
button.layer.borderColor = [[UIColor darkGrayColor] CGColor];

But do I need to know how to remove or remove the button border?

+5
source share
3 answers
button.layer.borderWidth = 0.0;

Make the border invisible.

+14
source
button.layer.borderColor = [UIColor colorWithRed:0.3 green:0.6 blue:0.9 alpha:0.1];
//                                set 'alpha' to something less than 1. -----^^^

Try it!

+1
source

In UILabel this does not work, I used the following (given that you added only 1 sublevel) (This is in Mono C #, but you can easily translate it)

label.Layer.Sublayers[0].RemoveFromSuperLayer();
0
source

All Articles