UIButton.selected does not cover the entire width of the button?

Edit: here is a screenshot:

screenshot

The button on the right is selected. I want the color to fill the entire button.

Buttons are created on a storyboard with fixed widths. I just switch selected / not selected with

button.selected = YES; 

I did not find similar questions on adjusting the width of the selected part, and I could not find any solutions. Any ideas?

+6
source share
1 answer

Make sure your UIButton type is Custom and not System.

Custom button type

+4
source

Source: https://habr.com/ru/post/973266/


All Articles