I don't know what happened even though I copy exactly the code from Android Developer Team official Youtube. The textfield
turns red BUT when I remove color = Color.black
in SearchBar
composable, everything works fine. Help me
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MySootheApp()
}
}
}
@Composable
fun SearchBar(
modifier: Modifier = Modifier
) {
TextField(
value = "",
onValueChange = {},
color = Color.Black,
leadingIcon = { Icon(Icons.Default.Search , contentDescription = null) },
placeholder = { Text(text = "Search Here") },
modifier = Modifier
.heightIn(min = 56.dp)
.fillMaxWidth(),
)
}
I have tried to remove color = Color.Black
and it works fine