val id = "inlineContent"
val inlineContent = mapOf(
Pair(
id,
InlineTextContent(
Placeholder(
width = 1.em,
height = 1.em,
placeholderVerticalAlign = PlaceholderVerticalAlign.AboveBaseline
)
) {
Icon(imageVector = Icons.Default.OpenInNew, contentDescription = null)
}
)
)
Text(
text = buildAnnotatedString {
append("open here")
appendInlineContent(id, "[open in new]")
},
inlineContent = inlineContent,
fontSize = 24.sp,
)
PlaceholderVerticalAlign で上下の位置を指定できる。中央揃えにするなら PlaceholderVerticalAlign.TextCenter がよさげ。
0 件のコメント:
コメントを投稿