UIButton background color for highlighted/selected state issue

前端 未结 6 1873
隐瞒了意图╮
隐瞒了意图╮ 2021-02-18 18:47

I\'ve a UIButton and I\'ve created an extension to add background color for different state.

I\'m using the following code:



        
6条回答
  •  Happy的楠姐
    2021-02-18 19:29

    To implement custom button illumination, you need: - Set in the storyboard the background color and alpha that you want to see, when button is pressed - At the time of initialization, set the background and alpha as a button that is not pressed -Implement three methods for the button (Touch Down / Touch Up Side / Touch Drag Outside) - In them, change the button illumination

提交回复
热议问题