Reputation: 15
I can't understand how I can make this shape with short bottom angle:
I tried searching information about shapes and only found about rounded corners.
Upvotes: 0
Views: 925
Reputation: 2000
You can use CutCornerShape
like this:
Button(
onClick = { /*TODO*/ },
shape = CutCornerShape(
topStart = 0f,
topEnd = 0f,
bottomEnd = 0f,
bottomStart = 100f
),
colors = ButtonDefaults.buttonColors(backgroundColor = Color.Green.copy(alpha = 0.25f)),
border = BorderStroke(width = 1.dp, Color.Green),
contentPadding = PaddingValues(horizontal = 64.dp)
) {
Text(
text = "Button",
color = Color.Green
)
}
The effect:
Upvotes: 1
Reputation: 15
Find this solution:
@Composable
fun ButtonWithCutCornerShape() {
Button(onClick = {}, shape = CutCornerShape(bottomStart = 50.dp)) {
Text(text = "Cut corner shape")
}
}
Upvotes: 1