Jetpack Compose: Hiding TextField Cursor, Cursor Handle, and Text Toolbar
Let me start by explaining what these components are.
TextToolbar
: TheToolbar
which had theCopy
&Cut
options are calledTextToolbar
.Cursor handle
: The two drops at the bottom of the text are calledCursor handle
.
Cursor
: The black line that blinks till the text field is focused.
When we want to create a customized TextField
, we might have requirements to remove/hide these.
Cursor
We can use cursorBrush
property to change the cursor color to Transparent like this,
TextToolbar
For TextToolbar
, we can use CompositionLocalProvider
to change it from the default one.
Cursor Handle
For Curso handle
also, we can make use of CompositionLocalProvider
to change it from the default one.
Sample Code
Please comment with your valuable feedback. It would help me to improvise.
Kindly 👏👏👏 if this was useful.
Please follow if you would like to see more content related to Android Jetpack Compose.
LinkedIn: https://www.linkedin.com/in/abhimanyu-n/