具有 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章