如果单词太长而无法放入,如何用连字符换行。
例如:
|<----screen space----->|
"This is example of veryLongWord." // very long sentence :P
Currently sentence line break like this.
|<------screen space------>|
This is example of |<----->|empty space
veryLongWord.
I want to achieve this:
|<------screen space------>|
This is example of veryLon-
gWord.
最佳答案
因此,在任何人前来救援之前,就我查看 Text() API 而言,没有针对您想要的开箱即用的解决方案。
即使那样,它听起来不像您正在寻找的东西,我所知道的唯一可以使用的解决方案是。
Text(
...
textAlign = TextAlign.Justify,
softWrap = true
...
)
关于android - 如果 android jetpack compose 中的单词太长,则用连字符打破句子行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68655165/