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

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