I am facing weird issue, I have OutlinedButton whi...
# compose
v
I am facing weird issue, I have OutlinedButton which contains Icon. Problem is icon image is showing too small. It seems like modifier.size(24.dp) does not seem working inside Icon. However, scale() works. Any suggestions?
e
Is there any padding applied to the icon ?
v
No
e
Maybe you can share the code, along with your question.. it might be easier for other to understand.
v
Copy code
OutlinedButton(
    modifier = modifier.size(size),
    shape = shape,
    onClick = onClick,
    enabled = enabled,
    colors = ButtonDefaults.buttonColors(
        backgroundColor = backgroundColor,
    )
) {
    Icon(
        painter = painterResource(id = icon),
        contentDescription = null,
        tint = tint,
        modifier = modifier.size(24.dp) //this value can be anything
    )
}
e
Do try to set content padding to 0.dp, usually solves the problem.
v
tried just now but no luck
Seems like except scale() no other function works on modifier for icon
when its inside OutlinedButton
s
If you put this same exact
Icon()
composable but outside of the button, does it look any different?
v
@Eganathan R Content Padding works, my bad I missed the word Content & just applied padding, thanks