Using the code structure below, is there any way t...
# compose
s
Using the code structure below, is there any way to prevent the jittering effect caused by the dynamic height change of the
AdBanner
? For example, is there a method to decouple the dynamic
AdBanner
height from the scrollable content’s padding so that the scroll state isn’t affected?
Copy code
@Composable
fun TestComposable() {
    val scrollState = rememberScrollState()
    Scaffold(
        bottomBar = {
            // AdBanner height can change dynamically
            AdBanner(
                modifier = Modifier
                    .fillMaxWidth()
                    .heightIn(max = 100.dp)
            )
        }
    ) { paddingValues ->
        Column(
            modifier = Modifier
                .fillMaxSize()
                // PaddingValues calculated from bottomBar are applied here
                .padding(paddingValues)
                .verticalScroll(scrollState)
        ) {
            // Scrollable content
        }
    }
}