https://kotlinlang.org logo
Title
l

Lilly

06/30/2022, 9:37 PM
[SOLVED]
unselectedContentColor
of
Tab
is not respected. Do I miss something or is this a bug?
Tab(
                    selected = true,
                    text = { Text(stringResource(section.stringRes)) },
                    onClick = { selectedTabIndex = i },
                    selectedContentColor = LightGreen600,
                    unselectedContentColor = Color.Red
                )
s

Stylianos Gakis

06/30/2022, 9:43 PM
Your snippet does say
selected = true
tbf. Maybe post a snippet of what all of it looks like in your code?
l

Lilly

06/30/2022, 9:45 PM
It looks exactly the same when started on device. I would expect that only the selected item is light green and the others are red but they are all the same
@Stylianos Gakis ok wow, how stupid. I have overlooked the
selected
parameter 🤦‍♀️ Thanks for the notice. Has to be:
selected = selectedTabIndex == i
s

Stylianos Gakis

06/30/2022, 9:52 PM
Hehe it happens to everyone, don’t worry about it 🤗