UIImageView as button

后端 未结 5 1141
庸人自扰
庸人自扰 2020-12-12 17:48

I\'m trying to make a UIImageView accept actions and fire them everytime it clicked on the UIImageVie, but i\'m having hard time in getting it to work, please help me out

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 18:20

    UIImageView is not a UIControl so it doesn't have the addTarget:action:forControlEvents method as part of its interface. You can use a gesture recognizer instead.

提交回复
热议问题