I have a simple Jetpack Compose TabRow example on Kotlin from documentation, where I just changed a text and underline color. But there is an orange background color when the tab is pressed. I want to make it transparent.
var state by remember { mutableStateOf(0) }
val titles = listOf("TOP", "NEW", "HOT")
Column {
TabRow(
contentColor = MaterialTheme.colors.primaryVariant, // This is underline's color
selectedTabIndex = state
) {
titles.forEachIndexed { index, title ->
Tab(
selectedContentColor = MaterialTheme.colors.primaryVariant,
unselectedContentColor = MaterialTheme.colors.secondary,
text = { Text(title) },
selected = state == index,
onClick = { state = index }
)
}
}
Text(
modifier = Modifier.align(Alignment.CenterHorizontally),
text = "Text tab ${state + 1} selected",
style = MaterialTheme.typography.body1
)
}