How can I make an action for a picture?

我只是一个虾纸丫 提交于 2020-01-16 18:19:12

问题


In my program, I want the users could touch a picture so that an action will be activated. However, the function IBAction cannot allow me to connect it with the picture. Is there any method that can help me to trigger a function when the users touch the picture? Thank you!


回答1:


You can activate the User Interaction for that picture, and then detect taps on it and trigger the action based on them. But the simplest solution would be to just put a button behind it, and connect the IBAction to that button. That's what we do in such cases.



来源:https://stackoverflow.com/questions/8643115/how-can-i-make-an-action-for-a-picture

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!