在运行时使用 UIGestureRecognizer 创建 UIImage
我希望能够添加一个特定大小的新 UIImageView,它应该有一些 UIGestureRecognizers 检测 UIImageView 上的触摸。
如何子类化 UIImageView 或者如何最好地实现这一点?
我希望用户能够在运行时添加他们想要的 UIImageViews,然后gestureRecognizer将允许他们操作视图。
谢谢
I would like to be able to add a new UIImageView of a certain size which should have a few UIGestureRecognizers detecting touch on the UIImageView.
How does one subclass UIImageView or how would this be best achieved?
I want the user to be able to add UIImageViews as they want at runtime and then the gestureRecognizer will allow them to manipulate the views.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您只是忘记启用 userInteractions。
I think you just forgot to enable userInteractions.