How to highlight a UIButton subclass?

后端 未结 2 404
予麋鹿
予麋鹿 2021-01-29 01:33

I have a subclass of UIButton where I overwrite drawRect for a custom looking button.

But now the cell doesn\'t highlight.

How can I f

2条回答
  •  伪装坚强ぢ
    2021-01-29 01:52

    subclassing UIButton does not make sense because it's a kind of assembly/cluster class.

    I had best experience creating own buttons when subclassing UIControl and add some custom behavior.

    Check also this (you should not subclass UIButton).

    Then also check how you highlight UIControl subclass.

提交回复
热议问题