iOS 26 Keyboard Toolbar with Menu Buttons: Menu appears above hidden toolbar (instead of taking up it's space)

Hi Community!

I'm wrangling with this for a few days now and can't find a way to fix it, but I see it working in other apps.

I have a regular UIToolbar with buttons, assigning it as inputAccessoryView to a UITextView, so the toolbar appears above the keyboard (I can reproduce this also in SwiftUI).

The toolbar contains regular UIBarButtonItems, except one doesn't have an action, it has a UIMenu (using .menu = UIMenu...).

In the Apple Notes app, there is also one button that shows a menu like that. When you tap on the button, the toolbar disappears and the menu shows directly above the keyboard.

However, in my code it shows above the hidden toolbar, means there is a huge gap between keyboard and menu. It works if I attach the toolbar (in SwiftUI) to the navigation at the top or bottom, just with the keyboard it behaves differently.

Here is some sample code for the toolbar:

private lazy var accessoryToolbar: UIToolbar = {
        let toolbar = UIToolbar()

        let bold = UIBarButtonItem(image: UIImage(systemName: "bold"), style: .plain, target: self, action: #selector(didTapToolbarButton(_:)))
		let italic = UIBarButtonItem(image: UIImage(systemName: "italic"), style: .plain, target: self, action: #selector(didTapToolbarButton(_:)))
		let underline = UIBarButtonItem(image: UIImage(systemName: "underline"), style: .plain, target: self, action: #selector(didTapToolbarButton(_:)))
		let todo = UIBarButtonItem(image: UIImage(systemName: "checklist"), style: .plain, target: self, action: #selector(didTapToolbarButton(_:)))

        // Make the Bullet button open a menu of list options
		let bullet = UIBarButtonItem(image: UIImage(systemName: "list.bullet"), style: .plain, target: self, action: nil)
		
		let bulletMenu = UIMenu(title: "Insert List", children: [
			UIAction(title: "Bulleted List", image: UIImage(systemName: "list.bullet")) { [weak self] _ in
				self?.handleMenuSelection("Bulleted List")
			},
			UIAction(title: "Numbered List", image: UIImage(systemName: "list.number")) { [weak self] _ in
				self?.handleMenuSelection("Numbered List")
			},
		])

		bullet.menu = bulletMenu
		toolbar.items = [bold, italic, underline, todo,  bullet]
		toolbar.sizeToFit()
        return toolbar
    }()

Somewhere else in the code assign it to the UITextView:

// Attach the toolbar above the keyboard
textView.inputAccessoryView = accessoryToolbar

Toolbar:

Menu open:

In Apple Notes:

I feel I miss something. In Apple notes I can also see a Liquid Glass style gradient between the toolbar and keyboard, dimming the content in this space.

I found one workaround, it seems inputAccessoryView is buggy, instead it works by adding the toolbar directly to the same view:

view.addSubview(toolbar)
        NSLayoutConstraint.activate([
            toolbar.leadingAnchor.constraint(equalTo: view.leadingAnchor),
            toolbar.trailingAnchor.constraint(equalTo: view.trailingAnchor),
            toolbar.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor)
        ])
iOS 26 Keyboard Toolbar with Menu Buttons: Menu appears above hidden toolbar (instead of taking up it's space)
 
 
Q