New Compose Multiplatform components arrived on Composables UICheck it out →

Modifier in Compose Foundation Layout

imeNestedScroll

Android

Controls the soft keyboard as a nested scrolling on Android [R][Build.VERSION_CODES.R] and later. This allows the user to drag the soft keyboard up and down.

After scrolling, the IME will animate either to the fully shown or fully hidden position, depending on the position and fling.

Last updated:

Installation

dependencies {
   implementation("androidx.compose.foundation:foundation-layout:1.7.0-beta04")
}

Overloads

@ExperimentalLayoutApi
fun Modifier.imeNestedScroll()

Code Example

windowInsetsNestedScrollDemo

@Composable
@Sampled
@OptIn(ExperimentalLayoutApi::class
fun windowInsetsNestedScrollDemo() {
    LazyColumn(
        modifier = Modifier
            .fillMaxSize() // fill the window
            .imePadding() // pad out the bottom for the IME
            .imeNestedScroll(), // scroll IME at the bottom
        reverseLayout = true // First item is at the bottom
    ) {
        // content
        items(50) {
            Text("Hello World")
        }
    }
}