Hi. I have a `TextField` with label. I want to cha...
# compose
v
Hi. I have a
TextField
with label. I want to change the
fontSize
of label but leave the behaviour that it becomes smaller when it floats to the top. If I change font size, the animation of decreasing size is gone and label has the same size in focused and unfocused mode. But if I don't set manually
fontSize
, everything works as expected. Any suggestions? Code in thread.
Copy code
TextField(
                value = emailText,
                onValueChange = onEmailChange,
                label = {
                    Text(
                        text = stringResource(id = R.string.email),
                        color = colorResource(id = R.color.login_text_color),
                        fontSize = 32.sp
                    )
                }
            )
a
may be your should manually animate the fontSize now by using
.animateFloatAsState
(I do not see .animate*Sp*AsState yet, so that’s why the Float)