When you set inputAccessoryView AND inputView you get unexpected system UI in between the two custom views

When you set inputAccessoryView AND inputView you get unexpected system UI in between the two custom views

If anyone has a workaround for this I'd love to hear it.

See also: https://stackoverflow.com/questions/79818015/uitextfield-custom-inputaccessoryview-with-custom-inputview-in-ios-26

Red == inputAccessoryView

Blue == inputView

Glassy bit in between == bug?

//
//  ViewController.swift
//  Custom Keyboard
//
//  Created by Lewis Smith on 19/02/2026.
//

import UIKit

class ViewController: UIViewController {

    let textField = {
        let textField = UITextField()
        textField.translatesAutoresizingMaskIntoConstraints = false
        textField.backgroundColor = .yellow

        let inputAccessoryView = UIView(frame: CGRect(x: 0, y: 0, width: .zero, height: 70))
        inputAccessoryView.backgroundColor = .red
        
        let inputView = UIView(frame: CGRect(x: 0, y: 0, width: .zero, height: 70))
        inputView.backgroundColor = .blue
     
        
        // When you set inputAccessoryView AND inputView you get unexpected UI inbetweeen the two custom views
        textField.inputAccessoryView = inputAccessoryView
        textField.inputView = inputView

        textField.becomeFirstResponder()
        
        return textField
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = .purple
        self.view.addSubview(textField)
        NSLayoutConstraint.activate([
            textField.centerXAnchor.constraint(equalTo: view.centerXAnchor),
            textField.centerYAnchor.constraint(equalTo: view.centerYAnchor),
            textField.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20),
            textField.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20),
        ])
    }


}

Hello lewis42,

Thanks for your documentation of this issue. Could you possibly please open a bug report in Feedback Assistant? Please feel free to copy over the same documentation from here to the bug report, though we also very much appreciate focused sample apps that can directly replicate issues.

Once you open the bug report, please post the FB number here for my reference. I'll make sure it gets to the relevant engineering team.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

Thank you for your vigilance,

Richard Yeh  Developer Technical Support

I imagine this is working as intended, not a bug. It’s the top of the keyboard. The documentation for UIInputView states

The UIInputView class is designed to match the appearance of the standard system keyboard when used as an input view with a responder.

You should avoid applying a background to the input view (blue in this example) to avoid covering up the system effects. This is how a “proper” input view + input accessory view looks on iOS 26:

When you set inputAccessoryView AND inputView you get unexpected system UI in between the two custom views
 
 
Q