Zoltan Demant
09/01/2023, 8:01 AMAnnotatedString
, I can specify a background for parts of the text with SpanStyle.background
... is it possible to specify how that background is rendered somehow, i.e. Id like it to have rounded corners?Alex Styl
09/01/2023, 8:03 AMZoltan Demant
09/01/2023, 8:06 AMText
per char?Alex Styl
09/01/2023, 8:11 AMFlowRow(horizontalArrangement = Arrangement.spacedBy(4.dp)) {
Text(
text = socialHandle,
modifier = Modifier.alignByBaseline(),
fontWeight = FontWeight.Medium
)
Text("added the", modifier = Modifier.alignByBaseline())
Text(
text = label,
fontWeight = FontWeight.Medium,
modifier = Modifier
.alignByBaseline()
.clip(MaterialTheme.shapes.small)
.background(tint)
.clickable {/* TODO */ }
.padding(horizontal = 4.dp, vertical = 2.dp)
)
Text("label on $time", modifier = Modifier.alignByBaseline())
}
=Alex Styl
09/01/2023, 8:11 AMZoltan Demant
09/01/2023, 8:12 AMZoltan Demant
09/01/2023, 8:26 AMmohamed rejeb
09/01/2023, 8:38 AMZoltan Demant
09/01/2023, 8:49 AMRick Regan
09/01/2023, 12:26 PMBox
you could instead have Text(modifier = Modifier.background(color = …, shape = RoundedCornerShape(...)))
. Then use Text(text = …, inlineContent = …)
(the example uses BasicText
but `Text`works too).
For the width and height in PlaceHolder
I use the font size.Zoltan Demant
09/01/2023, 12:43 PMRick Regan
09/01/2023, 12:55 PMZoltan Demant
09/01/2023, 1:51 PMRick Regan
09/01/2023, 3:34 PM