Ask Your Question
1

How do I adjust the height of a TextField in Jetpack Compose?

asked 2023-04-30 16:28:21 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-04-30 16:48:02 +0000

lalupa gravatar image

You can adjust the height of a TextField in Jetpack Compose by setting the height modifier of the TextField to the desired value. Here is an example:

TextField(
    modifier = Modifier
        .height(60.dp), // Set the height modifier to 60 dp
    value = text,
    onValueChange = { newText ->
        text = newText
    },
    label = { Text("Enter text") }
)

In this example, the height of the TextField is set to 60 dp using the height modifier. You can adjust the value of the height modifier to set the desired height for your TextField.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-04-30 16:28:21 +0000

Seen: 14 times

Last updated: Apr 30 '23