Dovydas
01/21/2025, 4:03 PMBox(
modifier = Modifier.fillMaxSize().pointerInput(Unit) { detectTapGestures(onTap = { focusManager.clearFocus() }) }
) {
TextButton(
modifier = Modifier.align(Alignment.TopEnd).padding(10.dp),
onClick = { }
) {
Text(stringResource(Res.string.help),)
}
Column(
modifier = Modifier.align(Alignment.Center),
horizontalAlignment = Alignment.CenterHorizontally
) {
OutlinedTextField(
Whenever I press on the TextField and it needs to move up because the keyboard is slightly in the way, the Help button at the top alos moves up, even though there is a lot of space between them. How can I make the Help message stay in place.
Note: I am using compose multiplatform and ios, I set:
fun MainViewController() = ComposeUIViewController(
configure = {
onFocusBehavior = OnFocusBehavior.DoNothing
}
) { Main() }
but that only prevents the topbar from moving up, the Help message still moves up unneccesarilyErick
01/21/2025, 4:58 PMZach Klippenstein (he/him) [MOD]
01/21/2025, 5:16 PMDovydas
01/21/2025, 5:35 PMDovydas
01/21/2025, 5:36 PMZach Klippenstein (he/him) [MOD]
01/21/2025, 5:36 PMModifier.verticalScroll
to, or your LazyColumn
.Dovydas
01/21/2025, 5:37 PMZach Klippenstein (he/him) [MOD]
01/21/2025, 5:42 PMimePadding
, contentPadding
, etcDovydas
01/21/2025, 5:47 PMZach Klippenstein (he/him) [MOD]
01/21/2025, 5:57 PMErick
01/21/2025, 6:09 PMDovydas
01/21/2025, 6:13 PMmodifier = Modifier.padding(WindowInsets.systemBars.asPaddingValues()).fillMaxSize().pointerInput(Unit) { detectTapGestures(onTap = { focusManager.clearFocus() }) }
Now the Help text is not in the status bar, but when the keyboard opens nothing moves and the textfield is obstructedZach Klippenstein (he/him) [MOD]
01/21/2025, 6:16 PMsystemBars
doesn't include IME padding i believe. Try safeContentPadding
Dovydas
01/21/2025, 6:22 PMZach Klippenstein (he/him) [MOD]
01/21/2025, 6:23 PMZach Klippenstein (he/him) [MOD]
01/21/2025, 6:23 PMDovydas
01/21/2025, 6:36 PMZach Klippenstein (he/him) [MOD]
01/21/2025, 6:40 PMimePadding
Dovydas
01/21/2025, 6:59 PMmodifier = Modifier.align(Alignment.Center).padding(bottom = (WindowInsets.ime.asPaddingValues().calculateBottomPadding() - 200.dp).coerceAtLeast(0.dp) ),
I'll try some more things out later but I got the general idea now. Thank you some much for the help :)