Philip Blandford
08/13/2025, 4:19 PMclass MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
TextFieldScrollTestTheme {
MainScreen()
}
}
}
}
@Composable
fun MainScreen() {
Scaffold(
contentWindowInsets = WindowInsets.safeDrawing,
) { innerPadding ->
MyScreenWithInput(innerPadding)
}
}
@Composable
fun MyScreenWithInput(innerPadding: PaddingValues) {
var text by remember { mutableStateOf("") }
Column(
modifier = Modifier
.fillMaxSize()
.imePadding()
.padding(innerPadding)
) {
LazyColumn(
modifier = Modifier
.weight(1f)
.fillMaxWidth()
.background(Color.Red),
contentPadding = PaddingValues(bottom = 8.dp)
) {
items(100) { index ->
Text(
text = "Item $index",
modifier = Modifier
.fillMaxWidth()
.padding(8.dp)
.background(Color.LightGray)
)
}
}
Column(
Modifier
.fillMaxWidth()
.background(Color(0xFFEFEFEF))
.padding(16.dp)
) {
BasicTextField(
value = text,
onValueChange = { text = it },
modifier = Modifier
.fillMaxWidth()
.height(100.dp)
.background(Color.Green)
.padding(8.dp)
)
Text(
text = "Type here $text",
modifier = Modifier
.fillMaxWidth()
.padding(top = 8.dp)
.background(Color.Yellow)
.padding(8.dp)
)
}
}
}
The contents of the whole screen just shoot right to the top.
I've tried both adjustResize and adjustNothing
If I put imePadding() on the BasicTextField instead, it obscures the bottom of the LazyColumn, which is not what I want either, I want that to push up so the bottom items are visible.
Edit: this Compose BOM 2025.07.00efemoney
08/14/2025, 12:35 PMefemoney
08/14/2025, 12:41 PMWindowInsets.safeDrawing