skip to Main Content

I’d like to change the input font size in TextField of Android Jetpack Compose because it’s very small now. Like this

2

Answers


  1. According to the documentation, there is a parameter textStyle that takes TextStyle that allows you to set font size via fontSize.

    You can do the following and it will set the font size to 28 sp

       TextField(value = "", onValueChange = {}, textStyle = TextStyle.Default.copy(fontSize = 28.sp))
    
    Login or Signup to reply.
  2. Now it is done using

    TextField(textStyle = androidx.compose.ui.text.TextStyle(
                    fontSize = fontSize,
                    fontFamily = fontFamily
                )) 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search