UIButton in Navigation Bar Not Recognizing Taps in iOS 11

前端 未结 3 1375
心在旅途
心在旅途 2020-12-18 01:09

I have a UIButton in a navigation bar that sits over the top of a UIImage and a UILabel. It worked fine in iOS 10, but now in iOS 11 i

3条回答
  •  清酒与你
    2020-12-18 01:56

    it's crazy but: in my situation i have custom NavBar with NavBarItems (rigth button in my case) and IMPORTANT: programmatically added UITapGestureRecognizer(for dismiss keyboard on tap around a textfield):

    let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
    view.addGestureRecognizer(tap)
    

    on iOS 10.3 - all be ok... on 11 - i have only my "tap" action... so when i dismiss TapGestureRecognizer - actions on NavBar start working...

    so, if you have some gestures on you screen - just try remove it...

    hope it's help for you

提交回复
热议问题