You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"I need some help. I don't know where to ask questions regarding this. The thing is, I want to view an image in full screen by hiding the navigation and status bars. I used WindowCompat.setDecorFitsSystemWindows(window, false) which started showing content behind the status bar. When I add the flags to hide the status and navigation bars, the content automatically takes margin from the top. I've tried everything available on the internet, but no luck. I can't figure out where I am going wrong. I've been trying this for at least 4 days, and I still haven't had any luck."
class MainActivity : ComponentActivity() {
@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
//showing the content behind status bar
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
MyApplicationTheme {
//hiding the status and nav bar
val systemUiController = rememberSystemUiController()
systemUiController.isStatusBarVisible = false // Status bar
systemUiController.isNavigationBarVisible = false // Navigation bar
systemUiController.isSystemBarsVisible = false // Status & Navigation bars
systemUiController.navigationBarDarkContentEnabled = true
// A surface container using the 'background' color from the theme
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.White)
.padding(0.dp),
) {
Greeting("Android")
}
}
}
}
}
what i achieved is the top status bar is hided but the box is not filling the size.. i am using pixel 7 on android 14 here
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
"I need some help. I don't know where to ask questions regarding this. The thing is, I want to view an image in full screen by hiding the navigation and status bars. I used
WindowCompat.setDecorFitsSystemWindows(window, false)
which started showing content behind the status bar.
When I add the flags to hide the status and navigation bars, the content automatically takes margin from the top. I've tried everything available on the internet, but no luck. I can't figure out where I am going wrong. I've been trying this for at least 4 days, and I still haven't had any luck."
what i achieved is the top status bar is hided but the box is not filling the size.. i am using pixel 7 on android 14 here
Beta Was this translation helpful? Give feedback.
All reactions