ios – The status bar colour is somehow is set this orange colour but when I open the side menu the colour is green, how to change it to green on all screens


App screenshot

As shown in the image the colour of the upper part is orange/yellow and when the side bar is opened or I attempt open it the colour is changed to green. How to make sure its the green colour all the time in all the view controllers.

I tried mimicking the status bar, by this but this also showed only when opening the side menu.

    override func viewDidLoad() {
        super.viewDidLoad()
        // Mimic the status bar
         if let statusBarFrame = UIApplication.shared.connectedScenes
             .compactMap({ $0 as? UIWindowScene })
             .flatMap({ $0.windows })
             .first?
             .windowScene?
             .statusBarManager?
             .statusBarFrame {

             let statusBarView = UIView(frame: statusBarFrame)
             statusBarView.backgroundColor = UIColor.green // Set your desired color
             view.addSubview(statusBarView)
         }

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img