Closed slikasgiedrius closed 2 weeks ago
Describe the bug I am looking for an advice how to remove safe area on ios below the bottom bar (removing top would be beneficial also). Thank you
Affected platforms
Screenshots
Code:
@Composable fun BottomNavigationExample() { val screens = listOf("Home", "Feed", "Alert", "Jobs") var selectedScreen by remember { mutableStateOf(screens.first()) } Scaffold( bottomBar = { BottomNavigation { screens.forEach { screen -> BottomNavigationItem( icon = { Icon(getIconForScreen(screen), contentDescription = screen) }, label = { Text(screen) }, selected = screen == selectedScreen, onClick = { selectedScreen = screen }, modifier = Modifier.padding(0.dp) ) } } }, content = { Column( modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally ) { Text(text = "Selected Screen: $selectedScreen") } } ) } @Composable fun getIconForScreen(screen: String): ImageVector { return when (screen) { "Home" -> Icons.Default.Home "Feed" -> Icons.Default.AccountBox "Alert" -> Icons.Default.Notifications "Jobs" -> Icons.Default.Done else -> Icons.Default.Home } }
You should add ignoresSafeArea to the root container. Example
ignoresSafeArea
Is it possible to achieve this inside multiplatform code? I am trying to stay away from platform-based changes as much as possible
No, root containers are platform-specific.
Describe the bug I am looking for an advice how to remove safe area on ios below the bottom bar (removing top would be beneficial also). Thank you
Affected platforms
Screenshots
Code: