且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

自定义UIView:未调用UIButton addTarget

更新时间:2022-11-20 10:48:59

最后,我得到了解决方案...对于面临相同问题的每个人:查看您的视图层次结构.我缺少popUpView和customView之间的链接,这就是为什么未正确触发触摸事件的原因.另一个错误是popUp从未正确锚定并且没有自己的框架...这就是为什么滑块根本不可操作的原因. 希望对您有所帮助!

So, finally I got the solution... For everybody that faces the same issue: Look at your view hierarchy. I was missing the linkn between my popUpView and my customView, thats why the touch events weren't triggered properly. Another mistake was that the popUp was never anchored properly and didn't have an own frame... That's why the slider wasn't operatable at all. I hope this helps some of you guys!