0

Iam using a Lazycolumn with an Image as first element. When I scroll up, while Iam already at the top the overscroll starts and leave a thin blank line between the image and the top of the device. This only appears in lightmode with a transparent statusbar and on a real device. I made a sample app to reproduce the behaviour. This is the code:

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        WindowCompat.setDecorFitsSystemWindows(window, false)
        setContent {

            SideEffect {
                val window = window
                window.statusBarColor = android.graphics.Color.TRANSPARENT
            }

              OverscrollTestTheme {
                // A surface container using the 'background' color from the theme
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colorScheme.background
                ) {
                    LazyColumn() {
                        item {
                            Box(modifier = Modifier.aspectRatio(4f/3).background(Color.Red))
                        }
                        items(100) {
                            Text(
                                text = "Element $it!",
                            )
                        }
                    }
                }
            }
        }
    }

I also made a small record where you can see this issue: https://www.youtube.com/shorts/8xJA4guVr3A

PhilipR
  • 61
  • 2

0 Answers0