I want to know if there is a way to apply multiple styles to a text, here I apply a material theme to this text, but I also want to change this text size, how can I do it ? since I have already used the style attribute
Text(text = "This is my default text", style = (MaterialTheme.typography).body1)
Also, how to add 2 modifiers , lets say I want to add padding and also a fillMaxWidth
For the TestStyle
you can use the merge
method.
Also if you want to use multiple modifiers you can concatenated them. In this case the order affects the final result.
Example:
Text(
text = "This is my default text",
style = (MaterialTheme.typography).body1
.merge(TextStyle(fontSize = 20.sp)),
modifier = Modifier
.padding(start = 16.dp)
.fillMaxWidth()
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With