iOS 26 UITabBar size issue

On iOS 26 not able to control size of UITabBar. Sharing code below. Colour is applying correctly but somehow _UITabBarPlatterView which turns out as TabBar is not extending; leaving spaces on left, right & bottom sides.

class CustomTabBar: UITabBar {
    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = .red
        
        let firstItem = UITabBarItem(title: "Home", image: UIImage(systemName: "house"), tag: 0)
        let secondItem = UITabBarItem(title: "Search", image: UIImage(systemName: "magnifyingglass"), tag: 1)
        let thirdItem = UITabBarItem(title: "Profile", image: UIImage(systemName: "person.circle"), tag: 2)
        
        items = [firstItem, secondItem, thirdItem]
        selectedItem = firstItem
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

class ViewController: UIViewController {
    let tabBar: CustomTabBar = {
        let tb = CustomTabBar()
        tb.translatesAutoresizingMaskIntoConstraints = false
        return tb
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .systemBackground
        view.addSubview(tabBar)
        NSLayoutConstraint.activate([
            tabBar.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 25),
            tabBar.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -25),
            tabBar.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor)
        ])
    }
}

when specifying height in CustomTabBar explicitly...

func alignInternalSubViews() {
        subviews.forEach { subView in
            subView.translatesAutoresizingMaskIntoConstraints = false
            NSLayoutConstraint.activate([
                subView.topAnchor.constraint(equalTo: topAnchor),
                subView.leadingAnchor.constraint(equalTo: leadingAnchor),
                subView.trailingAnchor.constraint(equalTo: trailingAnchor),
                subView.bottomAnchor.constraint(equalTo: bottomAnchor),
                subView.heightAnchor.constraint(equalToConstant: 62)
            ])
        }
    }

What should I need to do in order to get this capsule _UITabBarPlatterView and its subviews resize accordingly?

Answered by DTS Engineer in 852887022

Why not use a UITabBarController, and let the system handle all of the display and sizing metrics automatically for you? UITabBarViewController has some amazing capabilities to adapt itself to different environments, so I'd suggest going that direction to set yourself up for success with both the new design and adaptability in different environments.

— Ed Ford,  DTS Engineer

I have the same issue with a custom UITabBar.

Why not use a UITabBarController, and let the system handle all of the display and sizing metrics automatically for you? UITabBarViewController has some amazing capabilities to adapt itself to different environments, so I'd suggest going that direction to set yourself up for success with both the new design and adaptability in different environments.

— Ed Ford,  DTS Engineer

I have my own set of custom requirements for my app like the tab bar moves down when scrolling up and reappears on scroll down

The new design has features like that, in UITabBarController.MinimizeBehavior. As part of assessing how to adapt the new design, you should consider using the system-provided versions of features like this, so you don't need to continue maintaining your own custom implementations.

— Ed Ford,  DTS Engineer

iOS 26 UITabBar size issue
 
 
Q