1

Background is higher than textfield. enter image description here

How Can I fix that? Code: enter image description here

I played with padding. but it is not about it. i added column outside "OutlinedTextField" but it didnt worked. I want to make textfield same size with background.

Youssef Wagih
  • 121
  • 1
  • 8
  • 1
    [Please do not upload images of code/data/errors.](//meta.stackoverflow.com/q/285551/1772220) – ugexe Apr 16 '23 at 22:43

1 Answers1

0

You can add the background color using colors attribute in OutlinedTextField instead of modifier background as below code

        OutlinedTextField(
            value = "",
            onValueChange = {},
            Modifier
                .fillMaxWidth()
                .padding(
                    top = 10.dp,
                    start = 10.dp,
                    end = 10.dp,
                    bottom = 10.dp
                ),
            label = { Text("Input") },
            colors = TextFieldDefaults.outlinedTextFieldColors(
                focusedBorderColor = Green,
                unfocusedBorderColor = Yellow,
                backgroundColor = your_background_color
            ),
        )
Youssef Wagih
  • 121
  • 1
  • 8