Sam
03/16/2023, 10:17 PMColumn
content in the foreground that should respect WindowInsets
but have a background image that should bleed completely full screenChris Sinco [G]
03/16/2023, 10:44 PMWindowCompat.setDecorFitsSystemWindows(window, false)
you will have to handle all the insets. Components like Scaffold in Material3 have insets within it’s content scope, but you still have to pass that as a Modifier or PaddingValue to the child Composable you want to inset.Sam
03/16/2023, 10:50 PMsetDecorFitsSystemWindows
and content in the container view is using .navigationBarsPadding()
but if there is a child view within the Box
, how do i “break free” from the padding and go edge to edge? apply negative padding?Sam
03/16/2023, 10:52 PMSwiftUI
it’s really easy:
ZStack { // equiv to Box
Image().ignoresSafeArea() // full screen edge to edge
VStack { // equiv to Column
// content respecting insets
}
}
Chris Sinco [G]
03/16/2023, 10:56 PMnavigationBarsPadding
to a sibling of the Image instead of the Box and/or its parents.Sam
03/16/2023, 10:57 PMChris Sinco [G]
03/16/2023, 10:57 PMSam
03/16/2023, 10:59 PMChris Sinco [G]
03/16/2023, 11:00 PMSam
03/16/2023, 11:07 PMAlex Vanyo
03/16/2023, 11:08 PMnavigationBarsPadding()
) further down the hierarchy like Chris mentioned, so the Image
goes edge-to-edge naturally just by filling the max space in the parentSam
03/16/2023, 11:12 PMBox(
modifier.background(
Image(modifier.height(fullScreenHeight)
)
) {
// regular window inset content goes here
}
Alex Vanyo
03/16/2023, 11:31 PMSam
03/16/2023, 11:34 PMSam
03/16/2023, 11:36 PMSam
03/16/2023, 11:38 PMSam
03/16/2023, 11:39 PMiOS
codebase 😅Sam
03/16/2023, 11:43 PMChris Sinco [G]
03/16/2023, 11:47 PMAlex Vanyo
03/16/2023, 11:52 PMSam
03/16/2023, 11:56 PM