Home > Net >  Material3 IconButton fill color
Material3 IconButton fill color

Time:08-09

How to fill an entire circle with a color? The IconButton is from material3

IconButton(
            onClick = { /*TODO*/ },
            modifier = Modifier
                .size(50.dp)
                .padding(start = 32.dp)
                .border(1.dp, Color.White, shape = CircleShape),
            colors = IconButtonDefaults.iconButtonColors(
                containerColor = Color.White,
                contentColor = Color.Black
            )
        ) {
            Icon(
                imageVector = Icons.Default.Info,
                contentDescription = stringResource(id = R.string.cd_navigate_up)
            )
        }

enter image description here

CodePudding user response:

try adding background to your modifier:

 modifier = Modifier
                .size(50.dp)
                .padding(start = 32.dp)
                .background(color = Color.White,shape = CircleShape)
                .border(1.dp, Color.White, shape = CircleShape),
  • Related