0

I want to to decease he heigh of Outlined Text Field in jetpack compose. but when i add height(50) modifier then the text inside the OulinedTextField is cutting.

    OutlinedTextField(
        value = emailText,
        onValueChange = { text -> emailText = text },
        modifier = Modifier
            .fillMaxWidth()
            .height(50.dp)
            .padding(horizontal = 16.dp)
            .onFocusEvent {
                coroutineScope.launch {
                    bringIntoViewRequester.bringIntoView()
                }
            },
        shape = RoundedCornerShape(5.dp),
        label = { Text(text = "Email Address") },
        colors = TextFieldDefaults.textFieldColors(
            textColor = Color.White,
            focusedLabelColor = SignInTextColor,
            unfocusedLabelColor = SignInTextColor,
            focusedIndicatorColor = SignInTextColor,
            unfocusedIndicatorColor = SignInTextColor,
            containerColor = Color.Transparent
        ),
        keyboardOptions = KeyboardOptions(
            keyboardType = KeyboardType.Email,
            imeAction = ImeAction.Next
        )
    )

I have tried to adjust padding but still not getting exact results. by changing text size it is working but i want my OutlinedTextField text size to 17.sp

I have tried to use BasicTextField he hight is decreasing but when i use lable then that lable then that label is inside the the border not aligning on top of the line.

I want my text fields hight to 50.dp and text inside OutlinedTextFields to aligned in vertical-center and text size should be 17.sp, without cutting any text beacuse of bottom padding.

Ajay
  • 11
  • 1
  • Check https://stackoverflow.com/questions/75720212/how-to-reduce-the-height-of-androidx-compose-material3-outlinedtextfield/75720351#75720351 or https://stackoverflow.com/questions/74299661/jetpack-compose-how-to-use-custom-height-on-textfielddefaults-outlinedtextfiel/74300542#74300542 – Gabriele Mariotti Jun 28 '23 at 09:52
  • Does this answer your question? [How to reduce the height of androidx.compose.material3.OutlinedTextField](https://stackoverflow.com/questions/75720212/how-to-reduce-the-height-of-androidx-compose-material3-outlinedtextfield) – Abhimanyu Jun 28 '23 at 10:11

0 Answers0