导航栏按钮不可单击iOS13

导航栏按钮不可单击iOS13,ios,swift,uinavigationcontroller,uinavigationbar,uinavigationitem,Ios,Swift,Uinavigationcontroller,Uinavigationbar,Uinavigationitem,我的导航栏有问题。我转到“音频”视图控制器,如果我返回,我无法单击导航栏按钮菜单和“?” 我在iOS 10、iOS 11和iOS 12设备上的模拟器上测试,没有问题。我知道在iOS13中导航栏有一些变化 添加我的导航栏和菜单按钮的代码: let navBar = UINavigationBar() // Default attributes navBar.tintColor = MixedColors.clearWhiteColor() navBar.isTranslucent = false

我的导航栏有问题。我转到“音频”视图控制器,如果我返回,我无法单击导航栏按钮菜单和“?”

我在iOS 10、iOS 11和iOS 12设备上的模拟器上测试,没有问题。我知道在iOS13中导航栏有一些变化

添加我的导航栏和菜单按钮的代码:

let navBar = UINavigationBar()

// Default attributes
navBar.tintColor = MixedColors.clearWhiteColor()
navBar.isTranslucent = false
navBar.layer.elevate(elevation: 3)
navBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:MixedColors.clearWhiteColor()]
self.btnNetwork.alpha = 0
navBar.items = [UINavigationItem()]

// Ajout du boutton menu
let frame = CGRect(x: 0, y: 0, width: 25, height: 45)
self.btnMenu = UIView(frame: frame)
let imgView = UIImageView(frame: frame)
imgView.image = UIImage(named: "ic_menu")
imgView.contentMode = .scaleAspectFit
imgView.withColor(color: MixedColors.clearWhiteColor())
self.btnMenu.addSubview(imgView)
// Actions sur le menu
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(self.open))
self.btnMenu.isUserInteractionEnabled = true
self.btnMenu.addGestureRecognizer(tapGesture)

var leftButtonItems: [UIBarButtonItem] = []
let btn = UIBarButtonItem(customView: self.btnMenu)
btn.accessibilityIdentifier = "MenuBtn"
leftButtonItems.append(btn)
leftButtonItems.append(UIBarButtonItem(title: (self.title_bar), style: UIBarButtonItem.Style.plain, target: nil, action: #selector(self.open)))

navBar.items?.first?.setLeftBarButtonItems(leftButtonItems, animated: false)
要添加“”按钮的代码:


可能会有帮助。我正在使用Xcode 11.2.1。。。
guard let navigationBar = SAppState.sInst.navigationBar else { return }
let helpButton = UIBarButtonItem(image: UIImage(named: "ic_help_outline_white"), style: .plain, target: self, action: #selector(self.presentHelper))
navigationBar.items?[0].rightBarButtonItems = [helpButton]

SAppState.sInst.navigationBar = navigationBar