HomeiOS Developmentios - Xcode 26 (beta 6), iPadOS 26: StatusBar overlaps with NavigationBar...

ios – Xcode 26 (beta 6), iPadOS 26: StatusBar overlaps with NavigationBar after introduced viewController rotates and dismissed


I wish to cover standing bar JUST for a introduced viewController. The problem relays when the introduced view seems, at first it appears there’s a further house within the navigationBar which should be fastened. Rotating and again it solves and appears good. The 2nd challenge is after we dismiss the viewController and the standing bar overlaps with the navigation bar.

I attempted eradicating line by line however on the finish I created a brand new check venture simply to duplicate the bug with few traces of code.

ParentViewController.swift

import UIKit

class ParentViewController: UIViewController {
    override func viewDidLoad() {
        tremendous.viewDidLoad()
        
        self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Left", type: .plain, goal: nil, motion: nil)
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Proper", type: .plain, goal: nil, motion: nil)
        
        self.navigationController?.navigationBar.backgroundColor = .orange
        
        let ubtton = UIButton()
        ubtton.body = self.view.bounds
        ubtton.setTitle("PRESENT", for: .regular)
        ubtton.setTitleColor(.grey, for: .regular)
        ubtton.addTarget(self, motion: #selector(showTestController), for: .touchUpInside)
        self.view.addSubview(ubtton)
    }
    
    @objc
    func showTestController() {
        let viewController = PresentedViewController()
        viewController.modalPresentationStyle = .fullScreen

        let navigationController = UINavigationController(rootViewController: viewController)
        navigationController.modalPresentationStyle = .fullScreen
        
        self.current(navigationController, animated: true)
    }
}

PresentedViewController.swift

import UIKit

class PresentedViewController: UIViewController {

    override func viewDidLoad() {
        tremendous.viewDidLoad()
        
        self.view.backgroundColor = .pink
        // Do any further setup after loading the view.
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Shut", type: .plain, goal: self, motion: #selector(shut))
    }
    
    @objc func shut() {
        self.dismiss(animated: true)
    }
    
    override var prefersStatusBarHidden: Bool {
        return true
    }
}

In iPadOS 18 it really works appropriately, however the challenge simply seems in iPadOS 26. In iPhones it really works appropriately.

Be aware: I run within the simulator with Xcode 26 beta 6

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments