objective c - Custom UIButton + subviews = no events -
basically have custom uibutton , custom button contains subviews. if add subviews uibutton, button stops responding event changes. i.e if tap on it doesn't respond selector. have set userinteractionenabled
. tried adding touchbegan , working. if remove subviews, uibutton works again.
how tap events button?
the subviews should have userinteractionenabled
set no
. happening here subviews getting touch events instead of uibutton. if doesn't work option override hittest:withevent:
in custom uibutton returns , not ask subviews if should handle event. see uiview docs more details.
Comments
Post a Comment