I’m learning Kotlin Multiplatform by doing a small app that will run on Andorid/IOS/Desktop. It shares all logic and UI.
I have an image in my home screen that looks like this like this:
But I want to disable the status bar so that I can use all of the available height to have something like this:
I have found a lot of information on how to do it for android, but I haven’t found anything that works for Multiplatform. Does anybody know how to do it?
Thanks in advance..
I have not found anything yet…
It can be done by adding .NoActionBar.Fullscreen
either adding android:theme or adding style.xml. Here’s a reference to Kotlin documentation – https://developer.android.com/training/system-ui/status
You can also manage the enabling and disabling of status programmatically.
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Hide the status bar
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
actionBar?.hide()
}
}