1

How can I change the size of the cursor (height) of a TextField in jetpack compose irrespective of font size ? any tips or tricks ?

Khaled
  • 31
  • 3

1 Answers1

1

Maybe this will help? https://stackoverflow.com/a/68860541

By playing with the gradient, you can make the colors Transparent on the ends of the cursor. I cannot make this work in Material 3 though...

BasicTextField(
    cursorBrush = Brush.verticalGradient(
        0.00f to Color.Transparent,
        0.35f to Color.Transparent,
        0.35f to Color.Green,
        0.90f to Color.Green,
        0.90f to Color.Transparent,
        1.00f to Color.Transparent
    )
)
Mike
  • 515
  • 6
  • 14