Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButton .selected doesn't cover whole width of button?

Edit: Here is the screenshot:

screenshot

The button on the right is selected. I'd like the color to fill the entire button.

The buttons are created on storyboard with widths pinned. I simply toggle selected/not selected with

button.selected = YES;

I have not found any similar questions about adjusting the width of the part that is selected, and I haven't been able to figure out any solutions. Any ideas?

like image 951
HelloThisIsMyName Avatar asked Aug 02 '14 19:08

HelloThisIsMyName


1 Answers

Make sure your UIButton's type is "Custom", not "System".

Custom button type

like image 87
rebello95 Avatar answered Sep 28 '22 23:09

rebello95