class MainActivity : ComponentActivity() {
    @OptIn(ExperimentalFoundationApi::class)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            val tabItems = listOf("Diziler", "Filmler", "Keşfet", "Profil")
            val pagerState = rememberPagerState()


            ButtomNavigationTheme {
                // A surface container using the 'background' color from the theme
                Surface(){
                    Column() {

                        TabRow(

                            selectedTabIndex = pagerState.currentPage,
                            backgroundColor = Malibu,
                            //PROBLEM IN HERE. BACKGROUNDCOLOR IS RED
                            modifier = Modifier.padding(all = 20.dp).background(color = Color.Transparent)

                        ){

                        }

background color = Malibu is red. Do I miss to import something? I dont know what to do. Or can I do this in a different way? this is the image of red error

these are my imports. I couldnt add in code because it was too long for the stackoverflow

1

There are 1 best solutions below

0
On BEST ANSWER

You have to specify the containerColor and contententColor separately. There is no backgroundColor in the Material3 version of TabRow.

@Composable
fun TabRow(
    selectedTabIndex: Int,
    modifier: Modifier = Modifier,
    containerColor: Color = TabRowDefaults.containerColor,
    contentColor: Color = TabRowDefaults.contentColor,
    ...
): Unit