https://kotlinlang.org logo
g

Grigorii Yurkov

10/23/2020, 6:31 PM
I am trying to make toolbar without menu icon.
Copy code
@Preview
@Composable
fun MyToolbar() {
    Text(
        text = "My Toolbar",
        fontWeight = FontWeight.Bold,
        fontSize = 20.sp,
        modifier = Modifier.background(MaterialTheme.colors.primary).height(56.dp).fillMaxWidth(),
        textAlign = TextAlign.Left,
        color = Color.White
    )
}
I decided to use
Text
, but it doesn't want to align left
a

Adam Powell

10/23/2020, 6:46 PM
Add
.wrapContentWidth(Alignment.Start)
to the end of your modifiers
👍 1