Home > OS >  How remove default padding in Button Jetpack Compose
How remove default padding in Button Jetpack Compose

Time:10-10

In View (MaterialButton) usually use this :

android:insetTop="0dp"
android:insetBottom="0dp"

Is there a substitute for inset in Jetpack Compose Button?

CodePudding user response:

Try it like so:

Button(
    onClick = { /*TODO*/ },
    //This is important:
    contentPadding = PaddingValues(0.dp)
) {

}

CodePudding user response:

All Compose components are made according to Material metrics. If you want to customize them in the best way, see how the Button element is made. Just hold Ctrl and click on the Button.

  • Related