Does anyone have any idea which `TextField` proper...
# compose
r
Does anyone have any idea which
TextField
property is responsible for drawing the thin horizontal line when in unfocused mode? It disappears when the textfield is focused. Right image is focused, left is unfocused
c
I believe that has to do more with the IME than Compose
t
That is the
indicatorColor
. You can alter this color via
Copy code
val colors = TextFieldDefaults.textFieldColors(
    focusedIndicatorColor = <http://Color.xyz|Color.xyz>,
    unfocusedIndicatorColor = <http://Color.xyz|Color.xyz>,
    disabledIndicatorColor = <http://Color.xyz|Color.xyz>,
    errorIndicatorColor = <http://Color.xyz|Color.xyz>
)

TextField(
    value = value,
    onValueChange = { value = it },
    colors = colors
)
The line seemingly disappears because it uses the accent color when focused which is apparently also your background color. See also: https://material.io/components/text-fields#filled-text-field
🔥 1
c
Ah yeah that is correct 👆
r
Thank you @Tobias Suchalla. that's exactly what i've been looking for