Action Handlers Not Working on View itself

前端 未结 2 1860
遥遥无期
遥遥无期 2021-01-27 11:23

Do action handlers not work directly on view instances?

Instead of attaching an action handler within the view, I want to attach it directly on the entire view itself.

2条回答
  •  天命终不由人
    2021-01-27 11:52

    The recommended solution is to make a custom view subclass. You can then add a click function the subclass that will handle click events automatically.

提交回复
热议问题