how to handle imepadding when textfield is at bottom of view in jetpack compose?

Viewed 111

When the basictextfield is at bottom of view and is focused, the basictextfield is moving to the center of screen. How can I stop that? If I remove imePadding(), only half of textfield is visible.

@AndroidEntryPoint
class MainActivity : ComponentActivity() {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        WindowCompat.setDecorFitsSystemWindows(window, false)

        setContent {
            var a by remember {
                mutableStateOf("")
            }
            Box(
                modifier = Modifier
                    .fillMaxSize()
                    .imePadding()
            ) {
                BasicTextField(
                    value = a, onValueChange = { a = it }, modifier = Modifier.align(
                        Alignment.BottomCenter
                    )
                )
            }
        }
    }
}

0 Answers
Related