Vaibhav Jaiswal
09/10/2024, 9:51 AMScaffold(
modifier = Modifier.fillMaxSize(),
bottomBar = {
Surface(
modifier = Modifier
.fillMaxWidth()
.imePadding(),
tonalElevation = 2.dp
) {
Text("BottomAppBar", modifier = Modifier.padding(24.dp))
}
},
contentWindowInsets = WindowInsets(0.dp)
) { innerPadding ->
LazyColumn(
modifier = Modifier
.fillMaxSize()
.padding(innerPadding),
contentPadding = PaddingValues(24.dp),
verticalArrangement = Arrangement.spacedBy(12.dp)
) {
item {
Box(
modifier = Modifier
.height(600.dp)
.fillParentMaxWidth()
.background(androidx.compose.ui.graphics.Color.Red)
)
}
item {
TextBox(modifier = Modifier.fillParentMaxWidth())
}
}
}
@Composable
fun TextBox(modifier: Modifier = Modifier) {
TextField(value = "", onValueChange = {}, modifier = modifier)
}
@Composable
fun XMLTextBox(modifier: Modifier = Modifier) {
AndroidView(
modifier = modifier,
factory = { EditText(it).apply { this.setBackgroundColor(Color.LTGRAY) } }
)
}
Now when I'm using Compose TextField the scaffold correctly moves the content up and I can see my Text Field
But when using the XML one, it gets hidden by keyboard
Can anyone help me out?Dmitriy Gaiduk
09/10/2024, 2:04 PMandroidx.compose.foundation.layout.imePadding
to LazyColumn
. Or change android:windowSoftInputMode
in AndroidManifest for correct work of XML EditTextVaibhav Jaiswal
09/10/2024, 3:37 PMimePadding()
to the LazyColumn, but that leaves alot of blank space below the text field
I tried using both adjustPan
and adjustResize
for the softInputMode
in Manifest
, but its still the same