Rounded Rect UIButton Without Border

I am trying to draw a normal rounded rectangle UIButton, but without a border. Ideally, I would like to change some settings to UIButtonto disable the border.

My problem is that if I change the button type to “custom”, I won’t get a beautiful blue selection gradient (which I want to keep) and I have no idea how to draw it manually.

+5
source share
4 answers

I used a UISegmentedControl with one segment for this. You can use tintColor, you will get a nice gradient. Relationships of events are slightly different, but not very important.

.

+2

. , "Default", "Highlighted", "Selected" .. , " ". , . , , "".

+4

UIButton. UIButton.

0

,

button.layer.borderWidth = 3;    
button.layer.borderColor = [UIColor whiteColor].CGColor;
0

All Articles