How do I add an image to an annotated text. I trie...
# compose
o
How do I add an image to an annotated text. I tried using inline content, but it doesn't seem to reserve vertical space for the image. Making it overlap text above and below it.
h
can you share a code sample showing how you are building your annotated string and inline content? InlineContent cannot wrap lines but it also shouldn't be able to draw over above and below lines.
o
Copy code
Surface {
    val inlineContent = mapOf(
        "boxId" to InlineTextContent(
            Placeholder(
                16f.em,
                16f.em,
                PlaceholderVerticalAlign.Center
            )
        ) {
            Box(
                Modifier
                    .background(Color.Red.copy(0.2f))
                    .fillMaxSize())
        }
    )
    val annotatedString = buildAnnotatedString {
        append(List(100) { "String" }.joinToString(" "))
        appendInlineContent("boxId")
        append(List(100) { "String" }.joinToString(" "))
    }
    Text(text = annotatedString, inlineContent = inlineContent)
}
😯 1
o
Maybe you could try a combo-breaker lib? https://github.com/romainguy/combo-breaker
👍 1
z
That looks like a bug, please file
o
Okay, will do that.