具有 UITapGestureRecognizer 的视图内的 UIButton - UIButton inside a view that has a UITapGestureRecognizer

问题:

I have view with a UITapGestureRecognizer .我有一个UITapGestureRecognizer视图。 So when I tap on the view another view appears above this view.因此,当我点击视图时,该视图上方会出现另一个视图。 This new view has three buttons.这个新视图有三个按钮。 When I now press on one of these buttons I don't get the buttons action, I only get the tap gesture action.当我现在按下这些按钮之一时,我没有得到按钮动作,我只得到点击手势动作。 So I'm not able to use these buttons anymore.所以我不能再使用这些按钮了。 What can I do to get the events through to these buttons?我该怎么做才能将事件传递到这些按钮? The weird thing is that the buttons still get highlighted.奇怪的是按钮仍然突出显示。

I can't just remove the UITapGestureRecognizer after I received it's tap.我不能在收到点击后删除 UITapGestureRecognizer。 Because with it the new view can also be removed.因为有了它,新视图也可以被删除。 Means I want a behavior like the fullscreen vide controls .意味着我想要像全屏视频控件这样的行为


解决方案:

参考一: https://en.stackoom.com/question/E20z
参考二: https://stackoom.com/question/E20z
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章