Forum Archive

Hide status bar using ui module

Penguin Master

I'm making an app using pythonista, but the status bar is messing it up. How do I hide the status bar? I tried

UIApplication.sharedApplication().statusBar().hidden = True 

But is only made the app crash. What should I do to fix this? Thanks in advance

DavinE

did you mean the Title Bar ?

present('fullscreen', hide_title_bar=True))

hide_title_bar=True

Penguin Master

@DavinE thanks, but I meant the status bar. ¯_(ツ)_/¯

cvp

@Penguin-Master said:

UIApplication.sharedApplication().statusBar().hidden = True

Your code crashes with, in _objc_exception.txt

The app was terminated due to an Objective-C exception. Details below:

2021-02-08 19:12:05.801667
App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window. Use the statusBarManager object on the window scene instead.

Penguin Master

@cvp so I make a main view into a subview instead?

cvp

Already discussed here

Sorry corrected

Penguin Master

@cvp I'm not sure exactly how to do this. Can you point me in the right direction? Here's my current code
```
import ui

from objc_util import UIApplication

subview = ui.WebView()

subview.load_url("https://google.com")

view = ui.View()

view.add_subview(subview)

view.present("fullscreen", hide_title_bar=True)

cvp

@Penguin-Master sorry, I didn't find a way anymore.

Penguin Master

@cvp that's ok :/