How can I change the size of the cursor (height) of a TextField in jetpack compose irrespective of font size ? any tips or tricks ?
Asked
Active
Viewed 373 times
1 Answers
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
-
does that work with TextField ? – Khaled Dec 02 '22 at 21:01
-
No it seems like cursorBrush exists only in some TextField variants, but not all. Sorry. – Mike Dec 02 '22 at 21:12